diff options
| author | grischka <grischka> | 2016-10-01 22:01:25 +0200 |
|---|---|---|
| committer | grischka <grischka> | 2016-10-01 22:01:25 +0200 |
| commit | 332cf5327fa090ce39089e29881e2c2effb753a4 (patch) | |
| tree | d83aeaa869240fd03e03482d5f92c01218bcccea | |
| parent | 5a23a72aeda9fcd7e91efe86348ecad28fc0fd60 (diff) | |
| download | tinycc-332cf5327fa090ce39089e29881e2c2effb753a4.tar.gz tinycc-332cf5327fa090ce39089e29881e2c2effb753a4.tar.bz2 | |
tccpp: parse_line_comment: fix possible buffer overrun
| -rw-r--r-- | tccpp.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -971,9 +971,9 @@ redo_start: else if (tok == TOK_LINEFEED) goto redo_start; 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) - p = parse_line_comment(p); + p = parse_line_comment(p - 1); break; _default: default: @@ -1954,7 +1954,7 @@ _line_num: goto ignore; tcc_warning("Ignoring unknown preprocessing directive #%s", get_tok_str(tok, &tokc)); ignore: - file->buf_ptr = parse_line_comment(file->buf_ptr); + file->buf_ptr = parse_line_comment(file->buf_ptr - 1); goto the_end; } /* ignore other preprocess commands or #! for C scripts */ |
