Skip to content

Commit

Permalink
Search fields in modinfo need leading \0 to avoid false positives.
Browse files Browse the repository at this point in the history
Reported by moetayuko.
  • Loading branch information
landley committed Feb 3, 2025
1 parent 1f8dece commit fd8d5eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion toys/other/modinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static void modinfo_file(char *full_name)

for (i=0; i<ARRAY_LEN(modinfo_tags); i++) {
char *field = modinfo_tags[i], *p = buf;
int slen = sprintf(toybuf, "%s=", field);
int slen = sprintf(toybuf, "%c%s=", 0, field);

while (p && p < end) {
p = memmem(p, end-p, toybuf, slen);
Expand Down

0 comments on commit fd8d5eb

Please sign in to comment.