diff options
author | Yaniv Kaul <ykaul@redhat.com> | 2020-01-07 12:57:29 +0200 |
---|---|---|
committer | Amar Tumballi <amarts@gmail.com> | 2020-01-10 01:13:00 +0000 |
commit | 497d9f7d51443f4f463ca00f4fdddc42c6464e0f (patch) | |
tree | 081b74b1bb0bfe3cb3242593e400bc7af634e637 /xlators | |
parent | 00c090b093c147a95bfb8fce93f08303993e1995 (diff) |
dht-rename.c: fix Coverity issues 1397018/7 - strcat into uninitialized value
initialize both src and dst if they were not initialized already.
fixes: CID#1397018
Change-Id: Ic91954423953e8bf24eaa11fc2798c554f304d28
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/cluster/dht/src/dht-rename.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht-rename.c b/xlators/cluster/dht/src/dht-rename.c index f6a530f8357..d9dbf50492f 100644 --- a/xlators/cluster/dht/src/dht-rename.c +++ b/xlators/cluster/dht/src/dht-rename.c @@ -503,6 +503,8 @@ dht_order_rename_lock(call_frame_t *frame, loc_t **loc, xlator_t **subvol) uuid_utoa_r(local->loc.pargfid, src); else if (local->loc.parent) uuid_utoa_r(local->loc.parent->gfid, src); + else + src[0] = '\0'; strcat(src, local->loc.name); @@ -518,6 +520,8 @@ dht_order_rename_lock(call_frame_t *frame, loc_t **loc, xlator_t **subvol) uuid_utoa_r(local->loc2.pargfid, dst); else if (local->loc2.parent) uuid_utoa_r(local->loc2.parent->gfid, dst); + else + dst[0] = '\0'; strcat(dst, local->loc2.name); ret = strcmp(src, dst); |