Skip to content

Commit 3fb109c

Browse files
evelikovlucasdemarchi
authored andcommitted
modinfo: skip parm entries without a name
Specially crafted/corrupt modules may have a parm/parmtype entry which lacks the "name:" prefix. Throw a warning and skip such entries. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Link: #451 Signed-off-by: Lucas De Marchi <demarchi@kernel.org>
1 parent fa9c2dc commit 3fb109c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tools/modinfo.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ static int process_parm(const char *key, const char *value, struct param **param
8888
return 0;
8989
}
9090

91+
if (colon == value) {
92+
ERR("Missing param name in value \"%s\"\n", value);
93+
return 0;
94+
}
95+
9196
name = value;
9297
namelen = colon - value;
9398
if (streq(key, "parm")) {

0 commit comments

Comments
 (0)