History

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

Edmund Grimley Evans committed 11 years ago

Commit 743684f1 parent c8996591 file · +2 −0Browse files

Unified · Split

tccpp.c+2−0
@@ -587,6 +587,8 @@ ST_FUNC uint8_t *parse_comment(uint8_t *p) · 586 unmodified lines
587587 file->buf_ptr = p;
588588 c = handle_eob();
589589 p = file->buf_ptr;
590+ if (c == CH_EOF)
591+ tcc_error("unexpected end of file in comment");
590592 if (c == '\\') {
591593 /* skip '\[\r]\n', otherwise just skip the stray */
592594 while (c == '\\') {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t