diff options
author | markd <markd@pkgsrc.org> | 2004-11-02 23:32:18 +0000 |
---|---|---|
committer | markd <markd@pkgsrc.org> | 2004-11-02 23:32:18 +0000 |
commit | 8d6731439de4e2bb6f9d33d4c358828588698b94 (patch) | |
tree | 0b13234609d02f1751bbedae37a87802962b4775 /misc/koffice/patches | |
parent | b1f760eedfcd29282845393e35878ff40523c165 (diff) | |
download | pkgsrc-8d6731439de4e2bb6f9d33d4c358828588698b94.tar.gz |
Improved integer overflow fix for KWord's PDF import filter. Official
koffice patch. Bump PKGREVISION.
Diffstat (limited to 'misc/koffice/patches')
-rw-r--r-- | misc/koffice/patches/patch-ac | 34 | ||||
-rw-r--r-- | misc/koffice/patches/patch-ad | 48 |
2 files changed, 82 insertions, 0 deletions
diff --git a/misc/koffice/patches/patch-ac b/misc/koffice/patches/patch-ac new file mode 100644 index 00000000000..92f1b0ed46f --- /dev/null +++ b/misc/koffice/patches/patch-ac @@ -0,0 +1,34 @@ +$NetBSD: patch-ac,v 1.6 2004/11/02 23:32:19 markd Exp $ + +--- filters/kword/pdf/xpdf/xpdf/Catalog.cc.orig 2004-10-23 20:01:23.000000000 +1300 ++++ filters/kword/pdf/xpdf/xpdf/Catalog.cc +@@ -12,6 +12,7 @@ + #pragma implementation + #endif + ++#include <limits.h> + #include <stddef.h> + #include "gmem.h" + #include "Object.h" +@@ -63,8 +64,8 @@ Catalog::Catalog(XRef *xrefA) { + } + pagesSize = numPages0 = obj.getInt(); + obj.free(); +- if (pagesSize*sizeof(Page *)/sizeof(Page *) != pagesSize || +- pagesSize*sizeof(Ref)/sizeof(Ref) != pagesSize) { ++ if ((unsigned) pagesSize >= INT_MAX / sizeof(Page *) || ++ (unsigned) pagesSize >= INT_MAX / sizeof(Ref)) { + error(-1, "Invalid 'pagesSize'"); + ok = gFalse; + return; +@@ -196,8 +197,8 @@ int Catalog::readPageTree(Dict *pagesDic + } + if (start >= pagesSize) { + pagesSize += 32; +- if (pagesSize*sizeof(Page *)/sizeof(Page *) != pagesSize || +- pagesSize*sizeof(Ref)/sizeof(Ref) != pagesSize) { ++ if ((unsigned) pagesSize >= INT_MAX / sizeof(Page *) || ++ (unsigned) pagesSize >= INT_MAX / sizeof(Ref)) { + error(-1, "Invalid 'pagesSize' parameter."); + goto err3; + } diff --git a/misc/koffice/patches/patch-ad b/misc/koffice/patches/patch-ad new file mode 100644 index 00000000000..6c995845dc7 --- /dev/null +++ b/misc/koffice/patches/patch-ad @@ -0,0 +1,48 @@ +$NetBSD: patch-ad,v 1.7 2004/11/02 23:32:19 markd Exp $ + +--- filters/kword/pdf/xpdf/xpdf/XRef.cc.orig 2004-10-23 20:01:23.000000000 +1300 ++++ filters/kword/pdf/xpdf/xpdf/XRef.cc +@@ -12,6 +12,7 @@ + #pragma implementation + #endif + ++#include <limits.h> + #include <stdlib.h> + #include <stddef.h> + #include <string.h> +@@ -76,7 +77,7 @@ XRef::XRef(BaseStream *strA, GString *ow + + // trailer is ok - read the xref table + } else { +- if (size*sizeof(XRefEntry)/sizeof(XRefEntry) != size) { ++ if ((unsigned) size >= INT_MAX / sizeof(XRefEntry)) { + error(-1, "Invalid 'size' inside xref table."); + ok = gFalse; + errCode = errDamaged; +@@ -273,7 +274,7 @@ GBool XRef::readXRef(Guint *pos) { + // table size + if (first + n > size) { + newSize = size + 256; +- if (newSize*sizeof(XRefEntry)/sizeof(XRefEntry) != newSize) { ++ if ((unsigned) newSize >= INT_MAX / sizeof(XRefEntry)) { + error(-1, "Invalid 'newSize'"); + goto err2; + } +@@ -420,7 +421,7 @@ GBool XRef::constructXRef() { + if (!strncmp(p, "obj", 3)) { + if (num >= size) { + newSize = (num + 1 + 255) & ~255; +- if (newSize*sizeof(XRefEntry)/sizeof(XRefEntry) != newSize) { ++ if ((unsigned) newSize >= INT_MAX / sizeof(XRefEntry)) { + error(-1, "Invalid 'obj' parameters."); + return gFalse; + } +@@ -445,7 +446,7 @@ GBool XRef::constructXRef() { + } else if (!strncmp(p, "endstream", 9)) { + if (streamEndsLen == streamEndsSize) { + streamEndsSize += 64; +- if (streamEndsSize*sizeof(int)/sizeof(int) != streamEndsSize) { ++ if ((unsigned) streamEndsSize >= INT_MAX / sizeof(int)) { + error(-1, "Invalid 'endstream' parameter."); + return gFalse; + } |