summaryrefslogtreecommitdiff
path: root/parse/tok.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2013-11-12 19:29:33 -0500
committerOri Bernstein <ori@eigenstate.org>2013-11-12 19:29:33 -0500
commit059eaf0d4366d07da1caa936ebdb5496bb7626b6 (patch)
treebfa3c26b07371f49c7546a61b3e2171bfb029ee5 /parse/tok.c
parentdabed9c4d7c7b367b08a4b2ede1b27f2d218052b (diff)
downloadmc-059eaf0d4366d07da1caa936ebdb5496bb7626b6.tar.gz
More range checking.
Make sure that we're not adding bad hex values to integers.
Diffstat (limited to 'parse/tok.c')
-rw-r--r--parse/tok.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/parse/tok.c b/parse/tok.c
index 7978e2e..08caa36 100644
--- a/parse/tok.c
+++ b/parse/tok.c
@@ -526,7 +526,7 @@ static Tok *number(int base)
continue;
if (c == '.')
isfloat = 1;
- else if (hexval(c) > base)
+ else if (hexval(c) < 0 || hexval(c) > base)
fatal(line, "Integer digit '%c' outside of base %d", c, base);
}