summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorShyamsundarR <srangana@redhat.com>2018-08-21 21:53:35 -0400
committerAmar Tumballi <amarts@redhat.com>2018-08-22 18:13:12 +0000
commitfaf736cb3043ade5b2ad3267c45d2ba0bce53b52 (patch)
treee787f7c8aeebe47ad4834ca21feedfcb55bf797f /libglusterfs
parent37cb48e5919a2eac2525245ce7a8185e17f514f2 (diff)
coverity: Multiple coverity fixes for issues with HIGH severity
glfs-fops.c 1391414 Uninitialized pointer read List head needed initialization glusterfsd-mgmt.c graph.c 1382431 Buffer not null terminated 1382417 Dereference before null check 1382347 Buffer not null terminated Cleaned usage of volfile_checksum member of gf_volfile_t struct across the code base. glusterd-tier.c 1382426 Resource leak 1370955 Dereference before null check The function fixed needs more work, but with tier almost being deprecated, addressed some parts of the reported coverity issues as appropriate. Tested using the following test cases: ./tests/basic/tier/new-tier-cmds.t ./tests/basic/tier/tier.t ./tests/basic/tier/bug-1214222-directories_missing_after_attach_tier.t ./tests/basic/tier/tier_lookup_heal.t ./tests/basic/tier/tier-heald.t ./tests/basic/tier/tier-snapshot.t ./tests/features/glfs-lease.t Change-Id: I396f1c34bb112bb22d2745ed279e1a4850cac4af Updates: bz#789278 Signed-off-by: ShyamsundarR <srangana@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/graph.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libglusterfs/src/graph.c b/libglusterfs/src/graph.c
index 26dfc4e6b81..03ef55c5892 100644
--- a/libglusterfs/src/graph.c
+++ b/libglusterfs/src/graph.c
@@ -1264,7 +1264,7 @@ glusterfs_graph_attach (glusterfs_graph_t *orig_graph, char *path,
INIT_LIST_HEAD (&volfile_obj->volfile_list);
snprintf (volfile_obj->vol_id, sizeof (volfile_obj->vol_id),
"%s", xl->volfile_id);
- strncpy (volfile_obj->volfile_checksum, sha256_hash,
+ memcpy (volfile_obj->volfile_checksum, sha256_hash,
sizeof (volfile_obj->volfile_checksum));
list_add (&volfile_obj->volfile_list, &this->ctx->volfile_list);