Address global-buffer-overflow issue seen in iterator
Address global-buffer-overflow issue seen in iterator

16:57:46 ==190670==ERROR: AddressSanitizer: global-buffer-overflow on address 0x00000061d409 at pc 0x0000004b676c bp 0x7fffdf6615d0 sp 0x7fffdf660d88
16:57:46 READ of size 10 at 0x00000061d409 thread T0
16:57:46     #0 0x4b676b in __asan_memcpy (/home/couchbase/jenkins/workspace/forestdb-addresssanitizer-master/build/forestdb/tests/functional/iterator_functional_test+0x4b676b)
16:57:46     #1 0x5bb496 in FdbIterator::FdbIterator(FdbKvsHandle*, bool, void const*, unsigned long, void const*, unsigned long, unsigned short) /home/couchbase/jenkins/workspace/forestdb-addresssanitizer-master/forestdb/src/iterator.cc:152:13
16:57:46     #2 0x5bc9f6 in FdbIterator::initIterator(FdbKvsHandle*, FdbIterator**, void const*, unsigned long, void const*, unsigned long, unsigned short) /home/couchbase/jenkins/workspace/forestdb-addresssanitizer-master/forestdb/src/iterator.cc:380:20
16:57:46     #3 0x50edb4 in reverse_seek_to_max_nokey() /home/couchbase/jenkins/workspace/forestdb-addresssanitizer-master/forestdb/tests/functional/iterator_functional_test.cc:3004:14
16:57:46     #4 0x51b197 in main /home/couchbase/jenkins/workspace/forestdb-addresssanitizer-master/forestdb/tests/functional/iterator_functional_test.cc:4136:5
16:57:46     #5 0x2aab5eb3976c in __libc_start_main /build/buildd/eglibc-2.15/csu/libc-start.c:226
16:57:46     #6 0x446290 in _start (/home/couchbase/jenkins/workspace/forestdb-addresssanitizer-master/build/forestdb/tests/functional/iterator_functional_test+0x446290)

Change-Id: Ib3c8326c918a9bc020ebf5ffaa3b0ce0908ecaf2
Reviewed-on: http://review.couchbase.org/65787
Tested-by: buildbot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>
Reviewed-by: Chiyoung Seo <fcffc23db27b19ee4ebba46695ee6b50e09216a2@couchbase.com>

wurikiji/forestdb,wurikiji/forestdb,couchbase/forestdb,couchbase/forestdb,hisundar/forestdb,hisundar/forestdb