summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2011-11-16 23:04:23 +0100
committerAlbert Astals Cid <aacid@kde.org>2011-11-16 23:04:23 +0100
commite1f4162e5c47a7aeda6a852f3bc7ec0d97cf0403 (patch)
tree07c521e5970e492a71db9fef789a825bde2242bb
parentdc8d28018daac6f521be3561f187c153c8e07bba (diff)
xpdf303: make strToUnsigned "safer"
-rw-r--r--ALL_DIFF19
1 files changed, 0 insertions, 19 deletions
diff --git a/ALL_DIFF b/ALL_DIFF
index 7def1c9..abe284e 100644
--- a/ALL_DIFF
+++ b/ALL_DIFF
@@ -20238,25 +20238,6 @@ diff -ru xpdf-3.02/xpdf/XRef.cc xpdf-3.03/xpdf/XRef.cc
obj1.free();
obj2.free();
obj3.free();
-@@ -829,14 +864,26 @@
- Guint XRef::strToUnsigned(char *s) {
-- Guint x;
-+ Guint x, d;
- char *p;
-- int i;
-
- x = 0;
-- for (p = s, i = 0; *p && isdigit(*p) && i < 10; ++p, ++i) {
-- x = 10 * x + (*p - '0');
-+ for (p = s; *p && isdigit(*p & 0xff); ++p) {
-+ d = *p - '0';
-+ if (x > (UINT_MAX - d) / 10) {
-+ break;
-+ }
-+ x = 10 * x + d;
- }
- return x;
- }
diff -ru xpdf-3.02/xpdf/XRef.h xpdf-3.03/xpdf/XRef.h
--- xpdf-3.02/xpdf/XRef.h 2007-02-27 23:05:52.000000000 +0100
+++ xpdf-3.03/xpdf/XRef.h 2011-08-15 23:08:53.000000000 +0200