summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/server
diff options
context:
space:
mode:
authorYaniv Kaul <ykaul@redhat.com>2020-01-14 17:11:15 +0200
committerAmar Tumballi <amar@kadalu.io>2020-01-23 16:44:16 +0000
commit92bf7634d67a574dba6d7e77501d605d7f33acc3 (patch)
tree03cbf46cd0f07c0128c558dd75487efba2af4c05 /xlators/protocol/server
parentbe673d9d093d977f4f38f2dba3f422c796db37b7 (diff)
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 <ykaul@redhat.com>
Diffstat (limited to 'xlators/protocol/server')
-rw-r--r--xlators/protocol/server/src/server.c4
1 files changed, 2 insertions, 2 deletions
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);
}