From: Boris Egorov <egorov@linux.com>
To: util-linux@vger.kernel.org
Cc: Boris Egorov <egorov@linux.com>
Subject: [PATCH 3/3] cfdisk: fix condition logic [cppcheck]
Date: Sat, 20 Jun 2015 01:41:01 +0600 [thread overview]
Message-ID: <1434742861-11704-4-git-send-email-egorov@linux.com> (raw)
In-Reply-To: <1434742861-11704-1-git-send-email-egorov@linux.com>
[disk-utils/cfdisk.c:1181] -> [disk-utils/cfdisk.c:1181]: (warning)
Possible null pointer dereference: data - otherwise it is redundant to
check it against null.
Signed-off-by: Boris Egorov <egorov@linux.com>
---
disk-utils/cfdisk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/disk-utils/cfdisk.c b/disk-utils/cfdisk.c
index 6f26a3d..4627107 100644
--- a/disk-utils/cfdisk.c
+++ b/disk-utils/cfdisk.c
@@ -1178,7 +1178,7 @@ inline static int extra_insert_pair(struct cfdisk_line *l, const char *name, con
assert(l);
- if (!data && !*data)
+ if (!data || !*data)
return 0;
lsl = scols_table_new_line(l->extra, NULL);
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
next prev parent reply other threads:[~2015-06-19 19:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-19 19:40 [PATCH 0/3] cppcheck warnings fixes Boris Egorov
2015-06-19 19:40 ` [PATCH 1/3] sys-utils/disk-utils/lib: fix printf format types [cppcheck] Boris Egorov
2015-06-19 19:41 ` [PATCH 2/3] libblkid/whereis: simplify some conditions [cppcheck] Boris Egorov
2015-06-19 19:41 ` Boris Egorov [this message]
2015-06-25 10:10 ` [PATCH 0/3] cppcheck warnings fixes Karel Zak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1434742861-11704-4-git-send-email-egorov@linux.com \
--to=egorov@linux.com \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox