Skip to content

Commit

Permalink
Merge pull request torvalds#760 from ojeda/kallsyms
Browse files Browse the repository at this point in the history
kallsyms: sync with v2 upstream patches
  • Loading branch information
ojeda authored May 6, 2022
2 parents 8a46b49 + 14eb175 commit 165a7fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/kallsyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#define KSYM_NAME_LEN 512

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

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

0 comments on commit 165a7fa

Please sign in to comment.