All of lore.kernel.org
 help / color / mirror / Atom feed
* master - libdm: exlicitly check for NULL
@ 2015-11-09  9:28 Zdenek Kabelac
  0 siblings, 0 replies; only message in thread
From: Zdenek Kabelac @ 2015-11-09  9:28 UTC (permalink / raw)
  To: lvm-devel

Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=84303dc17aeca9773d5644e4beccc267ab7a3153
Commit:        84303dc17aeca9773d5644e4beccc267ab7a3153
Parent:        f6c140e200177ef527c8943fbe0a94e2e6bd8b3f
Author:        Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate:    Mon Nov 9 09:44:26 2015 +0100
Committer:     Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Mon Nov 9 10:19:19 2015 +0100

libdm: exlicitly check for NULL

Coverity: another explict check for NULL, where coverity fails to
see it.
---
 libdm/libdm-report.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/libdm/libdm-report.c b/libdm/libdm-report.c
index b2e70d5..23d0955 100644
--- a/libdm/libdm-report.c
+++ b/libdm/libdm-report.c
@@ -437,7 +437,8 @@ static int _report_field_string_list(struct dm_report *rh,
 	/* one item */
 	if (list_size == 1) {
 		sl = (struct dm_str_list *) dm_list_first(data);
-		if (!(sort_value->value = field->report_string = dm_pool_strdup(rh->mem, sl->str))) {
+		if (!sl ||
+		    !(sort_value->value = field->report_string = dm_pool_strdup(rh->mem, sl->str))) {
 			log_error("dm_report_field_string_list: dm_pool_strdup failed");
 			goto out;
 		}
@@ -2218,6 +2219,7 @@ static const char *_tok_value_number(const char *s,
 	int is_float = 0;
 
 	*begin = s;
+	/* coverity[assign_where_compare_meant] */
 	while ((!is_float && (*s == '.') && ((is_float = 1))) || isdigit(*s))
 		s++;
 	*end = s;



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-11-09  9:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-09  9:28 master - libdm: exlicitly check for NULL Zdenek Kabelac

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.