mirror of
https://github.com/mirror/tinycc.git
synced 2025-03-12 09:00:09 +08:00
tccpp: parse_line_comment: fix possible buffer overrun
This commit is contained in:
parent
5a23a72aed
commit
332cf5327f
6
tccpp.c
6
tccpp.c
@ -971,9 +971,9 @@ redo_start:
|
|||||||
else if (tok == TOK_LINEFEED)
|
else if (tok == TOK_LINEFEED)
|
||||||
goto redo_start;
|
goto redo_start;
|
||||||
else if (parse_flags & PARSE_FLAG_ASM_FILE)
|
else if (parse_flags & PARSE_FLAG_ASM_FILE)
|
||||||
p = parse_line_comment(p);
|
p = parse_line_comment(p - 1);
|
||||||
} else if (parse_flags & PARSE_FLAG_ASM_FILE)
|
} else if (parse_flags & PARSE_FLAG_ASM_FILE)
|
||||||
p = parse_line_comment(p);
|
p = parse_line_comment(p - 1);
|
||||||
break;
|
break;
|
||||||
_default:
|
_default:
|
||||||
default:
|
default:
|
||||||
@ -1954,7 +1954,7 @@ _line_num:
|
|||||||
goto ignore;
|
goto ignore;
|
||||||
tcc_warning("Ignoring unknown preprocessing directive #%s", get_tok_str(tok, &tokc));
|
tcc_warning("Ignoring unknown preprocessing directive #%s", get_tok_str(tok, &tokc));
|
||||||
ignore:
|
ignore:
|
||||||
file->buf_ptr = parse_line_comment(file->buf_ptr);
|
file->buf_ptr = parse_line_comment(file->buf_ptr - 1);
|
||||||
goto the_end;
|
goto the_end;
|
||||||
}
|
}
|
||||||
/* ignore other preprocess commands or #! for C scripts */
|
/* ignore other preprocess commands or #! for C scripts */
|
||||||
|
Loading…
Reference in New Issue
Block a user