1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

device_id: add null id->name null check

for covscan
This commit is contained in:
David Teigland 2022-12-01 10:38:48 -06:00
parent f80273a107
commit 7552ed9010

View File

@ -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)); idtype_to_str(du->idtype), du->idname, dev_name(dev));
return 1; return 1;
} else if ((id->idtype == DEV_ID_TYPE_SYS_WWID) && !strncmp(id->idname, "t10", 3) && } else if ((id->idtype == DEV_ID_TYPE_SYS_WWID) && id->idname &&
du_t10[0] && !strcmp(id->idname, du_t10)) { !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. */ /* Compare the shorter form du t10 wwid to the dev t10 wwid. */
du->dev = dev; du->dev = dev;
dev->id = id; dev->id = id;