summaryrefslogtreecommitdiffstats
path: root/api/src/glfs-fops.c
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 /api/src/glfs-fops.c
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 'api/src/glfs-fops.c')
-rw-r--r--api/src/glfs-fops.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c
index cb6dffc9335..ee4271fb4dc 100644
--- a/api/src/glfs-fops.c
+++ b/api/src/glfs-fops.c
@@ -5095,7 +5095,7 @@ glfs_recall_lease_fd (struct glfs *fs,
inode_t *inode = NULL;
struct glfs_fd *glfd = NULL;
struct glfs_fd *tmp = NULL;
- struct list_head glfd_list;
+ struct list_head glfd_list = { 0, };
fd_t *fd = NULL;
uint64_t value = 0;
struct glfs_lease lease = {0, };
@@ -5106,6 +5106,8 @@ glfs_recall_lease_fd (struct glfs *fs,
recall_lease = up_data->data;
GF_VALIDATE_OR_GOTO ("gfapi", recall_lease, out);
+ INIT_LIST_HEAD(&glfd_list);
+
subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;