From: David Teigland <teigland@sourceware.org>
To: lvm-devel@redhat.com
Subject: main - device_id: add null id->name null check
Date: Thu, 1 Dec 2022 18:07:25 +0000 (GMT) [thread overview]
Message-ID: <20221201180725.412453858C52@sourceware.org> (raw)
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=7552ed9010f823d2ac2b99349c62dce8cd6fd506
Commit: 7552ed9010f823d2ac2b99349c62dce8cd6fd506
Parent: f80273a1071532115219ea7c23054e6bbb096039
Author: David Teigland <teigland@redhat.com>
AuthorDate: Thu Dec 1 10:38:48 2022 -0600
Committer: David Teigland <teigland@redhat.com>
CommitterDate: Thu Dec 1 10:38:48 2022 -0600
device_id: add null id->name null check
for covscan
---
lib/device/device_id.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/device/device_id.c b/lib/device/device_id.c
index aae875776..4fa02edc7 100644
--- a/lib/device/device_id.c
+++ b/lib/device/device_id.c
@@ -1844,8 +1844,8 @@ static int _match_du_to_dev(struct cmd_context *cmd, struct dev_use *du, struct
idtype_to_str(du->idtype), du->idname, dev_name(dev));
return 1;
- } else if ((id->idtype == DEV_ID_TYPE_SYS_WWID) && !strncmp(id->idname, "t10", 3) &&
- du_t10[0] && !strcmp(id->idname, du_t10)) {
+ } else if ((id->idtype == DEV_ID_TYPE_SYS_WWID) && id->idname &&
+ !strncmp(id->idname, "t10", 3) && du_t10[0] && !strcmp(id->idname, du_t10)) {
/* Compare the shorter form du t10 wwid to the dev t10 wwid. */
du->dev = dev;
dev->id = id;
reply other threads:[~2022-12-01 18:07 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20221201180725.412453858C52@sourceware.org \
--to=teigland@sourceware.org \
--cc=lvm-devel@redhat.com \
/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 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.