Skip to content

Commit 165a7fa

Browse files
authored
Merge pull request #760 from ojeda/kallsyms
kallsyms: sync with v2 upstream patches
2 parents 8a46b49 + 14eb175 commit 165a7fa

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)