diff options
author | Albert Astals Cid <aacid@kde.org> | 2011-11-16 23:04:23 +0100 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2011-11-16 23:04:23 +0100 |
commit | e1f4162e5c47a7aeda6a852f3bc7ec0d97cf0403 (patch) | |
tree | 07c521e5970e492a71db9fef789a825bde2242bb | |
parent | dc8d28018daac6f521be3561f187c153c8e07bba (diff) |
xpdf303: make strToUnsigned "safer"
-rw-r--r-- | ALL_DIFF | 19 |
1 files changed, 0 insertions, 19 deletions
@@ -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
|