From: Sage Weil Date: Fri, 28 Apr 2017 03:06:45 +0000 (-0400) Subject: libcephfs: handle path==null to ceph_get_osd_crush_location X-Git-Tag: v12.0.3~172^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a8ca3de522002a5e8da81bd2aa6de35a52a96219;p=ceph.git libcephfs: handle path==null to ceph_get_osd_crush_location Signed-off-by: Sage Weil --- diff --git a/src/libcephfs.cc b/src/libcephfs.cc index 0446edb99f1d..a196dc669d96 100644 --- a/src/libcephfs.cc +++ b/src/libcephfs.cc @@ -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; } }