]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librados: remove extra advance from objects_begin(position)
authorJosh Durgin <josh.durgin@inktank.com>
Fri, 21 Feb 2014 01:30:54 +0000 (17:30 -0800)
committerJosh Durgin <josh.durgin@inktank.com>
Sat, 22 Feb 2014 00:06:28 +0000 (16:06 -0800)
ObjectIterator::seek() already calls get_next() to update the
iterator's state. Calling it again goes one past where it should be.

When the iterator reached the end of the list, it deleted the ListCtx,
causing a segfault on further accesses.

Fixes: #7491
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
src/librados/librados.cc

index 258070aa4788766dcb73785791446632072f30ca..ed4fb86f6ab3d25650047480ed545add444a19ae 100644 (file)
@@ -1227,7 +1227,6 @@ librados::ObjectIterator librados::IoCtx::objects_begin(uint32_t pos)
   rados_objects_list_open(io_ctx_impl, &listh);
   ObjectIterator iter((ObjListCtx*)listh);
   iter.seek(pos);
-  iter.get_next();
   return iter;
 }