]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
librbd: reset snaps in rbd_snap_list() 25458/head
authorKefu Chai <kchai@redhat.com>
Mon, 3 Dec 2018 16:28:31 +0000 (00:28 +0800)
committerPrashant D <pdhange@redhat.com>
Mon, 10 Dec 2018 01:19:13 +0000 (20:19 -0500)
commit8c4df932378bb7c1f18245f84ee8cbb9356a02bc
tree7a050ef7aea4eda0dc5ab5bb5a8a8c97734b6216
parent5e2a4bf731c2a02f4afa4da597c4954437d14a87
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>
(cherry picked from commit 5431fba5c5c9122418b6a03df4ed89f86fbb35e3)
src/librbd/librbd.cc