diff options
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-tierd-svc-helper.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-tierd-svc-helper.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-tierd-svc-helper.c b/xlators/mgmt/glusterd/src/glusterd-tierd-svc-helper.c index b555a1a9ccb..42cf8968429 100644 --- a/xlators/mgmt/glusterd/src/glusterd-tierd-svc-helper.c +++ b/xlators/mgmt/glusterd/src/glusterd-tierd-svc-helper.c @@ -34,10 +34,14 @@ glusterd_svc_build_tierd_socket_filepath (glusterd_volinfo_t *volinfo, { char sockfilepath[PATH_MAX] = {0,}; char rundir[PATH_MAX] = {0,}; + int32_t len = 0; glusterd_svc_build_tierd_rundir (volinfo, rundir, sizeof (rundir)); - snprintf (sockfilepath, sizeof (sockfilepath), "%s/run-%s", - rundir, uuid_utoa (MY_UUID)); + len = snprintf (sockfilepath, sizeof (sockfilepath), "%s/run-%s", + rundir, uuid_utoa (MY_UUID)); + if ((len < 0) || (len >= sizeof(sockfilepath))) { + sockfilepath[0] = 0; + } glusterd_set_socket_filepath (sockfilepath, path, path_len); } |