Skip to content

Commit

Permalink
Merge pull request #36 from IVOES/fix-unbounded-write
Browse files Browse the repository at this point in the history
Fix unbounded write of sscanf()
  • Loading branch information
symisc authored May 16, 2023
2 parents da3e55a + d7444aa commit 504c0d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sod.c
Original file line number Diff line number Diff line change
Expand Up @@ -7769,7 +7769,7 @@ static tree *read_tree(char *filename)
while ((line = fgetl(fp)) != 0) {
char *id = calloc(256, sizeof(char));
int parent = -1;
sscanf(line, "%s %d", id, &parent);
sscanf(line, "%255s %d", id, &parent);
t.parent = realloc(t.parent, (n + 1) * sizeof(int));
t.parent[n] = parent;

Expand Down

0 comments on commit 504c0d3

Please sign in to comment.