From 92bf7634d67a574dba6d7e77501d605d7f33acc3 Mon Sep 17 00:00:00 2001 From: Yaniv Kaul Date: Tue, 14 Jan 2020 17:11:15 +0200 Subject: server.c: fix Coverity issue 1405844 (memory - illegal access) We can use memcpy() instead of strncpy() as both are strings that are 37 bytes (GF_UUID_BUF_SIZE) long. fixes: CID#1405844 Change-Id: Ic74e8817cd790c13e29f3e6be8f18f2bfff77115 updates: bz#1193929 Signed-off-by: Yaniv Kaul --- xlators/protocol/server/src/server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'xlators') diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c index 1b6f3946c5c..222dc9a18f1 100644 --- a/xlators/protocol/server/src/server.c +++ b/xlators/protocol/server/src/server.c @@ -1494,8 +1494,8 @@ server_process_child_event(xlator_t *this, int32_t event, void *data, INIT_LIST_HEAD(&tmp->status_list); tmp->name = gf_strdup(victim->name); tmp->child_up = _gf_true; - strncpy(tmp->volume_id, victim->graph->volume_id, - GF_UUID_BUF_SIZE); + memcpy(tmp->volume_id, victim->graph->volume_id, + GF_UUID_BUF_SIZE); list_add_tail(&tmp->status_list, &conf->child_status->status_list); } -- cgit