aboutsummaryrefslogtreecommitdiff
path: root/tccpp.c
diff options
context:
space:
mode:
authorgrischka <grischka>2016-10-01 22:01:25 +0200
committergrischka <grischka>2016-10-01 22:01:25 +0200
commit332cf5327fa090ce39089e29881e2c2effb753a4 (patch)
treed83aeaa869240fd03e03482d5f92c01218bcccea /tccpp.c
parent5a23a72aeda9fcd7e91efe86348ecad28fc0fd60 (diff)
downloadtinycc-332cf5327fa090ce39089e29881e2c2effb753a4.tar.gz
tinycc-332cf5327fa090ce39089e29881e2c2effb753a4.tar.bz2
tccpp: parse_line_comment: fix possible buffer overrun
Diffstat (limited to 'tccpp.c')
-rw-r--r--tccpp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tccpp.c b/tccpp.c
index 159ad75..d1e6b59 100644
--- a/tccpp.c
+++ b/tccpp.c
@@ -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 */