From 773aaddc656a57b23bfae60808f099439329602c Mon Sep 17 00:00:00 2001 From: nik-redhat Date: Fri, 25 Sep 2020 18:39:51 +0530 Subject: dht: explicit null dereference Added a null check for uuid_list_copy, to avoid null dereference in strtok_r() in case of strdup() failure. CID: 1325612 CID: 1274223 Updates: #1060 Change-Id: I641a5068cd76d7b2ed92eccf39e7f97d6f7b2480 Signed-off-by: nik-redhat --- xlators/cluster/dht/src/dht-common.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'xlators/cluster/dht/src/dht-common.c') diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index 42e143e3a5a..aa3f938e9bc 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -4314,6 +4314,8 @@ dht_find_local_subvol_cbk(call_frame_t *frame, void *cookie, xlator_t *this, index = conf->local_subvols_cnt; uuid_list_copy = gf_strdup(uuid_list); + if (!uuid_list_copy) + goto unlock; for (uuid_str = strtok_r(uuid_list, " ", &saveptr); uuid_str; uuid_str = next_uuid_str) { -- cgit