aboutsummaryrefslogtreecommitdiff
path: root/graphics/kdegraphics4
diff options
context:
space:
mode:
authorMichael Nottebrock <lofi@FreeBSD.org>2007-01-18 10:22:23 +0000
committerMichael Nottebrock <lofi@FreeBSD.org>2007-01-18 10:22:23 +0000
commitcd7f9031312253337a245444c6b8a9a8831c38c3 (patch)
tree2c7323ea2c1e2b8ce32932be9ac51126fce7fbe5 /graphics/kdegraphics4
parent07e3dedf9702916653e21b54aa9500286ff0f7f2 (diff)
downloadports-cd7f9031312253337a245444c6b8a9a8831c38c3.tar.gz
ports-cd7f9031312253337a245444c6b8a9a8831c38c3.zip
Notes
Diffstat (limited to 'graphics/kdegraphics4')
-rw-r--r--graphics/kdegraphics4/Makefile3
-rw-r--r--graphics/kdegraphics4/files/patch-post-3.5.5-kdegraphics-CVE-2007-0104.diff61
2 files changed, 63 insertions, 1 deletions
diff --git a/graphics/kdegraphics4/Makefile b/graphics/kdegraphics4/Makefile
index d9274f56f546..e316a72b0b35 100644
--- a/graphics/kdegraphics4/Makefile
+++ b/graphics/kdegraphics4/Makefile
@@ -8,6 +8,7 @@
PORTNAME= kdegraphics
PORTVERSION= ${KDE_VERSION}
+PORTREVISION= 1
CATEGORIES= graphics kde
MASTER_SITES= ${MASTER_SITE_KDE}
MASTER_SITE_SUBDIR= stable/${PORTVERSION:S/.0//}/src
@@ -37,7 +38,7 @@ USE_GMAKE= yes
WANT_GNOME= yes
USE_GHOSTSCRIPT=yes
-INSTALLS_SHLIB= yes
+USE_LDCONFIG= yes
LDCONFIG_DIRS+= %%PREFIX%%/lib %%PREFIX%%/lib/kde3
DO_NOT_COMPILE+=kooka kuickshow libkscan
diff --git a/graphics/kdegraphics4/files/patch-post-3.5.5-kdegraphics-CVE-2007-0104.diff b/graphics/kdegraphics4/files/patch-post-3.5.5-kdegraphics-CVE-2007-0104.diff
new file mode 100644
index 000000000000..092cf67f360b
--- /dev/null
+++ b/graphics/kdegraphics4/files/patch-post-3.5.5-kdegraphics-CVE-2007-0104.diff
@@ -0,0 +1,61 @@
+--- kpdf/xpdf/xpdf/Catalog.cc
++++ kpdf/xpdf/xpdf/Catalog.cc
+@@ -26,6 +26,12 @@
+ #include "UGString.h"
+ #include "Catalog.h"
+
++// This define is used to limit the depth of recursive readPageTree calls
++// This is needed because the page tree nodes can reference their parents
++// leaving us in an infinite loop
++// Most sane pdf documents don't have a call depth higher than 10
++#define MAX_CALL_DEPTH 1000
++
+ //------------------------------------------------------------------------
+ // Catalog
+ //------------------------------------------------------------------------
+@@ -76,7 +82,7 @@ Catalog::Catalog(XRef *xrefA) {
+ pageRefs[i].num = -1;
+ pageRefs[i].gen = -1;
+ }
+- numPages = readPageTree(pagesDict.getDict(), NULL, 0);
++ numPages = readPageTree(pagesDict.getDict(), NULL, 0, 0);
+ if (numPages != numPages0) {
+ error(-1, "Page count in top-level pages object is incorrect");
+ }
+@@ -191,7 +197,7 @@ GString *Catalog::readMetadata() {
+ return s;
+ }
+
+-int Catalog::readPageTree(Dict *pagesDict, PageAttrs *attrs, int start) {
++int Catalog::readPageTree(Dict *pagesDict, PageAttrs *attrs, int start, int callDepth) {
+ Object kids;
+ Object kid;
+ Object kidRef;
+@@ -236,9 +242,13 @@ int Catalog::readPageTree(Dict *pagesDic
+ // This should really be isDict("Pages"), but I've seen at least one
+ // PDF file where the /Type entry is missing.
+ } else if (kid.isDict()) {
+- if ((start = readPageTree(kid.getDict(), attrs1, start))
+- < 0)
+- goto err2;
++ if (callDepth > MAX_CALL_DEPTH) {
++ error(-1, "Limit of %d recursive calls reached while reading the page tree. If your document is correct and not a test to try to force a crash, please report a bug.", MAX_CALL_DEPTH);
++ } else {
++ if ((start = readPageTree(kid.getDict(), attrs1, start, callDepth + 1))
++ < 0)
++ goto err2;
++ }
+ } else {
+ error(-1, "Kid object (page %d) is wrong type (%s)",
+ start+1, kid.getTypeName());
+--- kpdf/xpdf/xpdf/Catalog.h
++++ kpdf/xpdf/xpdf/Catalog.h
+@@ -128,7 +128,7 @@ private:
+ Object acroForm; // AcroForm dictionary
+ GBool ok; // true if catalog is valid
+
+- int readPageTree(Dict *pages, PageAttrs *attrs, int start);
++ int readPageTree(Dict *pages, PageAttrs *attrs, int start, int callDepth);
+ Object *findDestInTree(Object *tree, GString *name, Object *obj);
+ };
+