Skip to content

Commit 6db2983

Browse files
eulohmasahir0y
authored andcommitted
kallsyms: Handle too long symbols in kallsyms.c
When checking for symbols with excessively long names, account for null terminating character. Fixes: f3462aa ("Kbuild: Handle longer symbols in kallsyms.c") Signed-off-by: Eugene Loh <eugene.loh@oracle.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
1 parent f17b5f0 commit 6db2983

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/kallsyms.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ static int read_symbol(FILE *in, struct sym_entry *s)
118118
fprintf(stderr, "Read error or end of file.\n");
119119
return -1;
120120
}
121-
if (strlen(sym) > KSYM_NAME_LEN) {
122-
fprintf(stderr, "Symbol %s too long for kallsyms (%zu vs %d).\n"
121+
if (strlen(sym) >= KSYM_NAME_LEN) {
122+
fprintf(stderr, "Symbol %s too long for kallsyms (%zu >= %d).\n"
123123
"Please increase KSYM_NAME_LEN both in kernel and kallsyms.c\n",
124124
sym, strlen(sym), KSYM_NAME_LEN);
125125
return -1;

0 commit comments

Comments
 (0)