]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
librados: rados_inconsistent_pg_list() check "buf" param for null before copying...
authorKefu Chai <kchai@redhat.com>
Fri, 3 Mar 2017 08:41:51 +0000 (16:41 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 3 Mar 2017 08:56:59 +0000 (16:56 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/librados/librados.cc

index b13118787f8a6280bd3431084cf0a9c1d60bcf4f..d2f7b280bd4c9bcd670f7d1e9b951af937eebd50 100644 (file)
@@ -3002,7 +3002,7 @@ CEPH_RADOS_API int rados_inconsistent_pg_list(rados_t cluster, int64_t pool_id,
     ss << pg;
     auto s = ss.str();
     unsigned rl = s.length() + 1;
-    if (len >= rl) {
+    if (b && len >= rl) {
       tracepoint(librados, rados_inconsistent_pg_list_pg, s.c_str());
       strncat(b, s.c_str(), rl);
       b += rl;