]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
librados: invalid free() in rados_getxattrs_next()
authorGu Zhongyan <guzhongyan@360.cn>
Fri, 2 Feb 2018 10:01:05 +0000 (18:01 +0800)
committerPrashant D <pdhange@redhat.com>
Thu, 8 Feb 2018 02:40:46 +0000 (21:40 -0500)
commite2f57c44745563fa294673d486b10dc9974d5a3d
tree2fc6e26a05e089b731f43f7f37a1cc8ded5bfde8
parent13f400f80182c4fe0ebe8f9be19fa63898003f0b
librados: invalid free() in rados_getxattrs_next()

Invalid free() can cause corruption when getting an object
attribute with empty value.

Check the validity of the pointer before free(). Also move
the free() call at the start of rados_getxattrs_next() to
avoid memory leak.

Fixes: http://tracker.ceph.com/issues/22042
Signed-off-by: Gu Zhongyan <guzhongyan@360.cn>
(cherry picked from commit 015736d484415d20c4570ddd77216d7668a0bb9e)
src/librados/librados.cc