]> git.apps.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)
committerGu Zhongyan <guzhongyan@360.cn>
Mon, 5 Feb 2018 04:06:12 +0000 (12:06 +0800)
commit015736d484415d20c4570ddd77216d7668a0bb9e
tree309c09fcc1966c315c3730b9172a20f6e8b1295e
parentd9637b7675dff8777f0f1026f0fecb379ccbfd75
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>
src/librados/librados.cc