summaryrefslogtreecommitdiff
path: root/sys/src/cmd/cc/lex.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2020-04-19 23:37:05 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2020-04-19 23:37:05 +0200
commit0d59a2358a2a1f93fb28cd7f47f8420fbf06a9af (patch)
treecd6870a2b7489a68492908fdece342653193e3e9 /sys/src/cmd/cc/lex.c
parente24bfa4941679fafc7578f542acc08acd18fff99 (diff)
?a, cc: fix buffer overflows in built-in preprocessor (macbody)
add a buffer size argument to macexpand() and check for overflow. check for overflow when parsing #include directives.
Diffstat (limited to 'sys/src/cmd/cc/lex.c')
-rw-r--r--sys/src/cmd/cc/lex.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/src/cmd/cc/lex.c b/sys/src/cmd/cc/lex.c
index 5419f26bf..0fac0c95b 100644
--- a/sys/src/cmd/cc/lex.c
+++ b/sys/src/cmd/cc/lex.c
@@ -760,7 +760,7 @@ talph:
if(s->macro) {
newio();
cp = ionext->b;
- macexpand(s, cp);
+ macexpand(s, cp, sizeof(ionext->b));
pushio();
ionext->link = iostack;
iostack = ionext;