aboutsummaryrefslogtreecommitdiff
path: root/editors
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 /editors
parent07e3dedf9702916653e21b54aa9500286ff0f7f2 (diff)
downloadports-cd7f9031312253337a245444c6b8a9a8831c38c3.tar.gz
ports-cd7f9031312253337a245444c6b8a9a8831c38c3.zip
Patch denial of service vulnerability in PDF parser.
Security: CVE-2007-0104
Notes
Notes: svn path=/head/; revision=182715
Diffstat (limited to 'editors')
-rw-r--r--editors/calligra/Makefile3
-rw-r--r--editors/calligra/files/patch-koffce-xpdf-CVE-2007-0104.diff74
-rw-r--r--editors/koffice-kde3/Makefile3
-rw-r--r--editors/koffice-kde3/files/patch-koffce-xpdf-CVE-2007-0104.diff74
-rw-r--r--editors/koffice-kde4/Makefile3
-rw-r--r--editors/koffice-kde4/files/patch-koffce-xpdf-CVE-2007-0104.diff74
6 files changed, 228 insertions, 3 deletions
diff --git a/editors/calligra/Makefile b/editors/calligra/Makefile
index 9cb07045d1ed..be4d53dee422 100644
--- a/editors/calligra/Makefile
+++ b/editors/calligra/Makefile
@@ -7,6 +7,7 @@
PORTNAME= koffice
PORTVERSION= 1.6.1
+PORTREVISION= 1
PORTEPOCH= 2
CATEGORIES= editors kde
MASTER_SITES= ${MASTER_SITE_KDE}
@@ -33,7 +34,7 @@ LIB_DEPENDS= GraphicsMagick++:${PORTSDIR}/graphics/GraphicsMagick \
RUN_DEPENDS= ${LOCALBASE}/lib/libpqxx.a:${PORTSDIR}/databases/postgresql-libpqxx
USE_AUTOTOOLS= libtool:15
-INSTALLS_SHLIB= yes
+USE_LDCONFIG= yes
PREFIX= ${KDE_PREFIX}
USE_BZIP2= yes
USE_GMAKE= yes
diff --git a/editors/calligra/files/patch-koffce-xpdf-CVE-2007-0104.diff b/editors/calligra/files/patch-koffce-xpdf-CVE-2007-0104.diff
new file mode 100644
index 000000000000..f5e51a1c706e
--- /dev/null
+++ b/editors/calligra/files/patch-koffce-xpdf-CVE-2007-0104.diff
@@ -0,0 +1,74 @@
+------------------------------------------------------------------------
+r622463 | aacid | 2007-01-11 23:05:54 +0100 (Thu, 11 Jan 2007) | 2 lines
+Changed paths:
+ M /branches/koffice/1.6/koffice/filters/kword/pdf/xpdf/xpdf/Catalog.cc
+ M /branches/koffice/1.6/koffice/filters/kword/pdf/xpdf/xpdf/Catalog.h
+
+Commiting the patch agreed between kpdf and poppler developers to fix MOAB-06-01-2007 issue.
+
+------------------------------------------------------------------------
+Index: filters/kword/pdf/xpdf/xpdf/Catalog.cc
+===================================================================
+--- filters/kword/pdf/xpdf/xpdf/Catalog.cc (revision 622462)
++++ filters/kword/pdf/xpdf/xpdf/Catalog.cc (revision 622463)
+@@ -24,6 +24,12 @@
+ #include "Link.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
+ //------------------------------------------------------------------------
+@@ -77,7 +83,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");
+ }
+@@ -171,7 +177,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;
+@@ -221,9 +227,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());
+Index: filters/kword/pdf/xpdf/xpdf/Catalog.h
+===================================================================
+--- filters/kword/pdf/xpdf/xpdf/Catalog.h (revision 622462)
++++ filters/kword/pdf/xpdf/xpdf/Catalog.h (revision 622463)
+@@ -82,7 +82,7 @@ private:
+ Object outline; // outline 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);
+ };
+
diff --git a/editors/koffice-kde3/Makefile b/editors/koffice-kde3/Makefile
index 9cb07045d1ed..be4d53dee422 100644
--- a/editors/koffice-kde3/Makefile
+++ b/editors/koffice-kde3/Makefile
@@ -7,6 +7,7 @@
PORTNAME= koffice
PORTVERSION= 1.6.1
+PORTREVISION= 1
PORTEPOCH= 2
CATEGORIES= editors kde
MASTER_SITES= ${MASTER_SITE_KDE}
@@ -33,7 +34,7 @@ LIB_DEPENDS= GraphicsMagick++:${PORTSDIR}/graphics/GraphicsMagick \
RUN_DEPENDS= ${LOCALBASE}/lib/libpqxx.a:${PORTSDIR}/databases/postgresql-libpqxx
USE_AUTOTOOLS= libtool:15
-INSTALLS_SHLIB= yes
+USE_LDCONFIG= yes
PREFIX= ${KDE_PREFIX}
USE_BZIP2= yes
USE_GMAKE= yes
diff --git a/editors/koffice-kde3/files/patch-koffce-xpdf-CVE-2007-0104.diff b/editors/koffice-kde3/files/patch-koffce-xpdf-CVE-2007-0104.diff
new file mode 100644
index 000000000000..f5e51a1c706e
--- /dev/null
+++ b/editors/koffice-kde3/files/patch-koffce-xpdf-CVE-2007-0104.diff
@@ -0,0 +1,74 @@
+------------------------------------------------------------------------
+r622463 | aacid | 2007-01-11 23:05:54 +0100 (Thu, 11 Jan 2007) | 2 lines
+Changed paths:
+ M /branches/koffice/1.6/koffice/filters/kword/pdf/xpdf/xpdf/Catalog.cc
+ M /branches/koffice/1.6/koffice/filters/kword/pdf/xpdf/xpdf/Catalog.h
+
+Commiting the patch agreed between kpdf and poppler developers to fix MOAB-06-01-2007 issue.
+
+------------------------------------------------------------------------
+Index: filters/kword/pdf/xpdf/xpdf/Catalog.cc
+===================================================================
+--- filters/kword/pdf/xpdf/xpdf/Catalog.cc (revision 622462)
++++ filters/kword/pdf/xpdf/xpdf/Catalog.cc (revision 622463)
+@@ -24,6 +24,12 @@
+ #include "Link.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
+ //------------------------------------------------------------------------
+@@ -77,7 +83,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");
+ }
+@@ -171,7 +177,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;
+@@ -221,9 +227,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());
+Index: filters/kword/pdf/xpdf/xpdf/Catalog.h
+===================================================================
+--- filters/kword/pdf/xpdf/xpdf/Catalog.h (revision 622462)
++++ filters/kword/pdf/xpdf/xpdf/Catalog.h (revision 622463)
+@@ -82,7 +82,7 @@ private:
+ Object outline; // outline 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);
+ };
+
diff --git a/editors/koffice-kde4/Makefile b/editors/koffice-kde4/Makefile
index 9cb07045d1ed..be4d53dee422 100644
--- a/editors/koffice-kde4/Makefile
+++ b/editors/koffice-kde4/Makefile
@@ -7,6 +7,7 @@
PORTNAME= koffice
PORTVERSION= 1.6.1
+PORTREVISION= 1
PORTEPOCH= 2
CATEGORIES= editors kde
MASTER_SITES= ${MASTER_SITE_KDE}
@@ -33,7 +34,7 @@ LIB_DEPENDS= GraphicsMagick++:${PORTSDIR}/graphics/GraphicsMagick \
RUN_DEPENDS= ${LOCALBASE}/lib/libpqxx.a:${PORTSDIR}/databases/postgresql-libpqxx
USE_AUTOTOOLS= libtool:15
-INSTALLS_SHLIB= yes
+USE_LDCONFIG= yes
PREFIX= ${KDE_PREFIX}
USE_BZIP2= yes
USE_GMAKE= yes
diff --git a/editors/koffice-kde4/files/patch-koffce-xpdf-CVE-2007-0104.diff b/editors/koffice-kde4/files/patch-koffce-xpdf-CVE-2007-0104.diff
new file mode 100644
index 000000000000..f5e51a1c706e
--- /dev/null
+++ b/editors/koffice-kde4/files/patch-koffce-xpdf-CVE-2007-0104.diff
@@ -0,0 +1,74 @@
+------------------------------------------------------------------------
+r622463 | aacid | 2007-01-11 23:05:54 +0100 (Thu, 11 Jan 2007) | 2 lines
+Changed paths:
+ M /branches/koffice/1.6/koffice/filters/kword/pdf/xpdf/xpdf/Catalog.cc
+ M /branches/koffice/1.6/koffice/filters/kword/pdf/xpdf/xpdf/Catalog.h
+
+Commiting the patch agreed between kpdf and poppler developers to fix MOAB-06-01-2007 issue.
+
+------------------------------------------------------------------------
+Index: filters/kword/pdf/xpdf/xpdf/Catalog.cc
+===================================================================
+--- filters/kword/pdf/xpdf/xpdf/Catalog.cc (revision 622462)
++++ filters/kword/pdf/xpdf/xpdf/Catalog.cc (revision 622463)
+@@ -24,6 +24,12 @@
+ #include "Link.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
+ //------------------------------------------------------------------------
+@@ -77,7 +83,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");
+ }
+@@ -171,7 +177,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;
+@@ -221,9 +227,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());
+Index: filters/kword/pdf/xpdf/xpdf/Catalog.h
+===================================================================
+--- filters/kword/pdf/xpdf/xpdf/Catalog.h (revision 622462)
++++ filters/kword/pdf/xpdf/xpdf/Catalog.h (revision 622463)
+@@ -82,7 +82,7 @@ private:
+ Object outline; // outline 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);
+ };
+