summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2018-05-25 22:46:22 +0200
committerAlbert Astals Cid <aacid@kde.org>2018-05-25 22:46:22 +0200
commitb245154fdebc9a78db163bc95959c6c8f5b4126f (patch)
tree3ee7cc9e3d710812c6d704de22393e112b146603
parent86777478387577aee8242eb2f11932041e87eff5 (diff)
Parser::makeStream: Don't overflow length
fixes oss-fuzz/8499
-rw-r--r--poppler/Parser.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/poppler/Parser.cc b/poppler/Parser.cc
index ce91e325..d1ddcaa2 100644
--- a/poppler/Parser.cc
+++ b/poppler/Parser.cc
@@ -261,7 +261,8 @@ Stream *Parser::makeStream(Object &&dict, Guchar *fileKey,
// When building the xref we can't use it so use this
// kludge for broken PDF files: just add 5k to the length, and
// hope its enough
- length += 5000;
+ if (length < LONG_LONG_MAX - 5000)
+ length += 5000;
}
}