Skip to content

Commit 14eb175

Browse files
committed
kallsyms: sync with v2 upstream patches
A couple differences: - A tab instead of spaces. - Use `sizeof()` as suggested by Kees Cook. Signed-off-by: Miguel Ojeda <[email protected]>
1 parent 8a46b49 commit 14eb175

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
@@ -33,7 +33,7 @@
3333
#define KSYM_NAME_LEN 512
3434

3535
/* A substantially bigger size than the current maximum. */
36-
#define KSYM_NAME_LEN_BUFFER 2048
36+
#define KSYM_NAME_LEN_BUFFER 2048
3737
_Static_assert(
3838
KSYM_NAME_LEN_BUFFER == KSYM_NAME_LEN * 4,
3939
"Please keep KSYM_NAME_LEN_BUFFER in sync with KSYM_NAME_LEN"
@@ -215,7 +215,7 @@ static struct sym_entry *read_symbol(FILE *in)
215215

216216
rc = fscanf(in, "%llx %c %" _stringify(KSYM_NAME_LEN_BUFFER) "s\n", &addr, &type, name);
217217
if (rc != 3) {
218-
if (rc != EOF && fgets(name, KSYM_NAME_LEN_BUFFER + 1, in) == NULL)
218+
if (rc != EOF && fgets(name, sizeof(name), in) == NULL)
219219
fprintf(stderr, "Read error or end of file.\n");
220220
return NULL;
221221
}

0 commit comments

Comments
 (0)