Skip to content

Commit 504c0d3

Browse files
authored
Merge pull request #36 from IVOES/fix-unbounded-write
Fix unbounded write of sscanf()
2 parents da3e55a + d7444aa commit 504c0d3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sod.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7769,7 +7769,7 @@ static tree *read_tree(char *filename)
77697769
while ((line = fgetl(fp)) != 0) {
77707770
char *id = calloc(256, sizeof(char));
77717771
int parent = -1;
7772-
sscanf(line, "%s %d", id, &parent);
7772+
sscanf(line, "%255s %d", id, &parent);
77737773
t.parent = realloc(t.parent, (n + 1) * sizeof(int));
77747774
t.parent[n] = parent;
77757775

0 commit comments

Comments
 (0)