From: Josh Durgin Date: Fri, 21 Feb 2014 01:30:54 +0000 (-0800) Subject: librados: remove extra advance from objects_begin(position) X-Git-Tag: v0.78~129^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d8a7befbc13adbf6eb9620ff99b8f35c974d0589;p=ceph.git librados: remove extra advance from objects_begin(position) 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 --- diff --git a/src/librados/librados.cc b/src/librados/librados.cc index 258070aa4788..ed4fb86f6ab3 100644 --- a/src/librados/librados.cc +++ b/src/librados/librados.cc @@ -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; }