]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
libcephfs: handle path==null to ceph_get_osd_crush_location 14859/head
authorSage Weil <sage@redhat.com>
Fri, 28 Apr 2017 03:06:45 +0000 (23:06 -0400)
committerSage Weil <sage@redhat.com>
Fri, 28 Apr 2017 03:06:45 +0000 (23:06 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/libcephfs.cc

index 0446edb99f1d21ed4f366f092d5155410ff091a3..a196dc669d96e9b0bd3e41ce2d429fddfcb457c8 100644 (file)
@@ -1224,9 +1224,11 @@ extern "C" int ceph_get_osd_crush_location(struct ceph_mount_info *cmount,
     string& name = it->second;
     needed += type.size() + name.size() + 2;
     if (needed <= len) {
-      strcpy(path + cur, type.c_str());
+      if (path)
+       strcpy(path + cur, type.c_str());
       cur += type.size() + 1;
-      strcpy(path + cur, name.c_str());
+      if (path)
+       strcpy(path + cur, name.c_str());
       cur += name.size() + 1;
     }
   }