1
0
mirror of https://github.com/mirror/tinycc.git synced 2025-04-25 14:00:22 +08:00

tccpp.c: Avoid infinite loop on: printf '/**' | ./tcc -

This commit is contained in:
Edmund Grimley Evans 2015-10-15 19:02:58 +01:00
parent c899659d39
commit 743684fe39

View File

@ -587,6 +587,8 @@ ST_FUNC uint8_t *parse_comment(uint8_t *p)
file->buf_ptr = p;
c = handle_eob();
p = file->buf_ptr;
if (c == CH_EOF)
tcc_error("unexpected end of file in comment");
if (c == '\\') {
/* skip '\[\r]\n', otherwise just skip the stray */
while (c == '\\') {