]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
librbd: reset snaps in rbd_snap_list()
authorKefu Chai <kchai@redhat.com>
Mon, 3 Dec 2018 16:28:31 +0000 (00:28 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 3 Dec 2018 16:32:11 +0000 (00:32 +0800)
commit5431fba5c5c9122418b6a03df4ed89f86fbb35e3
tree8575ae6a1624e385c89748b1fad53bc86b1d76c7
parent70242bf7b5712e189ed944defb2d7442490b9440
librbd: reset snaps in rbd_snap_list()

in SnapIterator in rbd.pyx, rbd_snap_list_end() is called by
SnapIterator.__dealloc__(). and rbd_snap_list_end() frees
snaps->name if it is not nullptr.  but there is chance that
snaps->name is never initialized after snaps is allocated by
SnapIterator.__init__, in that case, we will free() a wild pointer.

Fixes: http://tracker.ceph.com/issues/37508
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/librbd/librbd.cc