From d8a7befbc13adbf6eb9620ff99b8f35c974d0589 Mon Sep 17 00:00:00 2001 From: Josh Durgin Date: Thu, 20 Feb 2014 17:30:54 -0800 Subject: [PATCH] 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 --- src/librados/librados.cc | 1 - 1 file changed, 1 deletion(-) 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; } -- 2.47.3