From: Eugene Loh <eugene.loh@oracle.com>
Date: Thu, 17 Jan 2019 14:46:00 -0800
Subject: kallsyms: Handle too long symbols in kallsyms.c
Git-commit: 6db2983cd8064808141ccefd75218f5b4345ffae
Patch-mainline: v5.0-rc8
References: bsc#1126805
When checking for symbols with excessively long names,
account for null terminating character.
Fixes: f3462aa952cf ("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>
Acked-by: Miroslav Benes <mbenes@suse.cz>
---
scripts/kallsyms.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -123,8 +123,8 @@ static int read_symbol(FILE *in, struct
fprintf(stderr, "Read error or end of file.\n");
return -1;
}
- if (strlen(str) > KSYM_NAME_LEN) {
- fprintf(stderr, "Symbol %s too long for kallsyms (%zu vs %d).\n"
+ if (strlen(str) >= KSYM_NAME_LEN) {
+ fprintf(stderr, "Symbol %s too long for kallsyms (%zu >= %d).\n"
"Please increase KSYM_NAME_LEN both in kernel and kallsyms.c\n",
str, strlen(str), KSYM_NAME_LEN);
return -1;