summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2014-10-21 14:42:27 (GMT)
committerCarlos Garcia Campos <carlosgc@gnome.org>2014-10-21 14:44:00 (GMT)
commitf966b8766d40b2c912e69a1e17ef8cc4bd52be95 (patch)
tree2a9cae6e77976612192fbc2b21087fe126ae160d
parent4963332ca4db13d8a9186b06d2aa0d59abbc10ee (diff)
fofi: Fix a crash when parsing an invalid font due to a integer overflowHEADmaster
This fixes a crash rendering trust_metrics.f2495.f0.pdf.
-rw-r--r--fofi/FoFiType1.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/fofi/FoFiType1.cc b/fofi/FoFiType1.cc
index 8fa10a0..2245184 100644
--- a/fofi/FoFiType1.cc
+++ b/fofi/FoFiType1.cc
@@ -263,7 +263,7 @@ void FoFiType1::parse() {
} else {
break;
}
- for (; *p >= '0' && *p < '0' + base; ++p) {
+ for (; *p >= '0' && *p < '0' + base && code < INT_MAX / (base + (*p - '0')); ++p) {
code = code * base + (*p - '0');
}
for (; *p == ' ' || *p == '\t'; ++p) ;