Skip to content

Commit b197001

Browse files
committed
Guard against output tape record growing too large.
1 parent 5c5ef36 commit b197001

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

libword/tape-word.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,12 @@ write_tape_word (FILE *f, word_t word)
380380
}
381381
beginning_of_tape = 0;
382382

383+
if (reclen == sizeof record)
384+
{
385+
fprintf (stderr, "Output tape record too large.\n");
386+
exit (1);
387+
}
388+
383389
record[reclen++] = word;
384390
}
385391

0 commit comments

Comments
 (0)