History

tccpp: parse_line_comment: fix possible buffer overrun

grischka committed 10 years ago

Commit 332cf531 parent 5a23a721 file · +3 −3Browse files

Unified · Split

tccpp.c+3−3
@@ -971,9 +971,9 @@ redo_start: · 970 unmodified lines
971971 else if (tok == TOK_LINEFEED)
972972 goto redo_start;
973973 else if (parse_flags & PARSE_FLAG_ASM_FILE)
974− p = parse_line_comment(p);
974+ p = parse_line_comment(p - 1);
975975 } else if (parse_flags & PARSE_FLAG_ASM_FILE)
976− p = parse_line_comment(p);
976+ p = parse_line_comment(p - 1);
977977 break;
978978 _default:
979979 default:
@@ -1954,7 +1954,7 @@ _line_num: · 974 unmodified lines
19541954 goto ignore;
19551955 tcc_warning("Ignoring unknown preprocessing directive #%s", get_tok_str(tok, &tokc));
19561956 ignore:
1957− file->buf_ptr = parse_line_comment(file->buf_ptr);
1957+ file->buf_ptr = parse_line_comment(file->buf_ptr - 1);
19581958 goto the_end;
19591959 }
19601960 /* ignore other preprocess commands or #! for C scripts */

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