From 4de5b84ee01f4a749dc0a4b1f410d340d7157ace Mon Sep 17 00:00:00 2001 From: sdong Date: Wed, 23 Apr 2014 17:51:16 -0700 Subject: [PATCH] Fix a bug in IterKey Summary: IterKey set buffer_size_ to a wrong initial value, causing it to always allocate values from heap instead of stack if the key size is smaller. Fix it. Test Plan: make all check Reviewers: haobo, ljin Reviewed By: haobo CC: igor, dhruba, yhchiang, leveldb Differential Revision: https://reviews.facebook.net/D18279 --- db/dbformat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/dbformat.h b/db/dbformat.h index 27a082284..1c86b127a 100644 --- a/db/dbformat.h +++ b/db/dbformat.h @@ -280,7 +280,7 @@ class IterKey { delete[] key_; } key_ = space_; - buf_size_ = sizeof(buf_size_); + buf_size_ = sizeof(space_); key_size_ = 0; }