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
971 else if (tok == TOK_LINEFEED)971 else if (tok == TOK_LINEFEED)
972 goto redo_start;972 goto redo_start;
973 else if (parse_flags & PARSE_FLAG_ASM_FILE)973 else if (parse_flags & PARSE_FLAG_ASM_FILE)
974 p = parse_line_comment(p);974 p = parse_line_comment(p - 1);
975 } else if (parse_flags & PARSE_FLAG_ASM_FILE)975 } else if (parse_flags & PARSE_FLAG_ASM_FILE)
976 p = parse_line_comment(p);976 p = parse_line_comment(p - 1);
977 break;977 break;
978_default:978_default:
979 default:979 default:
@@ -1954,7 +1954,7 @@ _line_num: · 974 unmodified lines
1954 goto ignore;1954 goto ignore;
1955 tcc_warning("Ignoring unknown preprocessing directive #%s", get_tok_str(tok, &tokc));1955 tcc_warning("Ignoring unknown preprocessing directive #%s", get_tok_str(tok, &tokc));
1956 ignore:1956 ignore:
1957 file->buf_ptr = parse_line_comment(file->buf_ptr);1957 file->buf_ptr = parse_line_comment(file->buf_ptr - 1);
1958 goto the_end;1958 goto the_end;
1959 }1959 }
1960 /* ignore other preprocess commands or #! for C scripts */1960 /* 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