summaryrefslogtreecommitdiff
path: root/libdm/libdm-report.c
diff options
context:
space:
mode:
authorPeter Rajnoha <prajnoha@redhat.com>2016-06-27 10:12:41 +0200
committerAlasdair G Kergon <agk@redhat.com>2016-06-28 02:26:54 +0100
commitf0768f636edb8da08e46b029380779fd623399de (patch)
treed09cc06af31b27cd039e989f171df12420775607 /libdm/libdm-report.c
parenta46f5242471018faca5d20204d0bab5fb2d6b9cd (diff)
downloadlvm2-f0768f636edb8da08e46b029380779fd623399de.tar.gz
coverity: fix issues detected in recent code
Uninitialized variables (UNINIT) /safe/guest2/covscan/LVM2.2.02.158/tools/toollib.c: 3520 in _process_pvs_in_vgs() Uninitialized variables (UNINIT) Using uninitialized value "do_report_ret_code". Null pointer dereferences (REVERSE_INULL) /safe/guest2/covscan/LVM2.2.02.158/libdm/libdm-report.c: 4745 in dm_report_output() Null pointer dereferences (REVERSE_INULL) Null-checking "rh" suggests that it may be null, but it has already been dereferenced on all paths leading to the check. Incorrect expression (MISSING_COMMA) /safe/guest2/covscan/LVM2.2.02.158/lib/log/log.c: 280 in _get_log_level_name() Incorrect expression (MISSING_COMMA) In the initialization of "log_level_names", a suspicious concatenated string ""noticeinfo"" is produced. Null pointer dereferences (FORWARD_NULL) /safe/guest2/covscan/LVM2.2.02.158/tools/reporter.c: 816 in_get_report_options() Null pointer dereferences (FORWARD_NULL) Comparing "mem" to null implies that "mem" might be null.
Diffstat (limited to 'libdm/libdm-report.c')
-rw-r--r--libdm/libdm-report.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libdm/libdm-report.c b/libdm/libdm-report.c
index 6bea34cf8..ad03c6e28 100644
--- a/libdm/libdm-report.c
+++ b/libdm/libdm-report.c
@@ -4001,7 +4001,7 @@ static int _report_set_selection(struct dm_report *rh, const char *selection, in
goto_bad;
}
- if (!selection || !strcasecmp(selection, SPECIAL_SELECTION_ALL))
+ if (!selection || !selection[0] || !strcasecmp(selection, SPECIAL_SELECTION_ALL))
return 1;
rh->selection->add_new_fields = add_new_fields;
@@ -4742,7 +4742,7 @@ int dm_report_output(struct dm_report *rh)
else
r = _output_as_columns(rh);
out:
- if (r && rh && rh->group_item)
+ if (r && rh->group_item)
rh->group_item->output_done = 1;
return r;
}