summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Lohrke <carlo@gentoo.org>2005-12-06 01:39:03 +0000
committerCarsten Lohrke <carlo@gentoo.org>2005-12-06 01:39:03 +0000
commit218404eca1b5ba53c8f48f1ead93f4ea8cbcef04 (patch)
treecf869a036a200647461842e8a750ef6ceb51e5ff /kde-base/kpdf/files
parentformat string vulnerability, #114583 (diff)
downloadgentoo-2-218404eca1b5ba53c8f48f1ead93f4ea8cbcef04.tar.gz
gentoo-2-218404eca1b5ba53c8f48f1ead93f4ea8cbcef04.tar.bz2
gentoo-2-218404eca1b5ba53c8f48f1ead93f4ea8cbcef04.zip
vulnerabilities in included xpdf code, #114429
(Portage version: 2.0.53)
Diffstat (limited to 'kde-base/kpdf/files')
-rw-r--r--kde-base/kpdf/files/digest-kpdf-3.4.3-r11
-rw-r--r--kde-base/kpdf/files/digest-kpdf-3.5.0-r11
-rw-r--r--kde-base/kpdf/files/kpdf-3.4.3-CAN-2005-3193.patch119
-rw-r--r--kde-base/kpdf/files/kpdf-3.5.0-CAN-2005-3193.patch118
-rw-r--r--kde-base/kpdf/files/kpdf-3.5.0-splitter-io.patch38
5 files changed, 277 insertions, 0 deletions
diff --git a/kde-base/kpdf/files/digest-kpdf-3.4.3-r1 b/kde-base/kpdf/files/digest-kpdf-3.4.3-r1
new file mode 100644
index 000000000000..2cb888ba9f29
--- /dev/null
+++ b/kde-base/kpdf/files/digest-kpdf-3.4.3-r1
@@ -0,0 +1 @@
+MD5 e2b2926301204a0f587d9e6e163c06d9 kdegraphics-3.4.3.tar.bz2 6554272
diff --git a/kde-base/kpdf/files/digest-kpdf-3.5.0-r1 b/kde-base/kpdf/files/digest-kpdf-3.5.0-r1
new file mode 100644
index 000000000000..44e671a5ef99
--- /dev/null
+++ b/kde-base/kpdf/files/digest-kpdf-3.5.0-r1
@@ -0,0 +1 @@
+MD5 389a00d4387e621d4dd325a59c7657c4 kdegraphics-3.5.0.tar.bz2 7094349
diff --git a/kde-base/kpdf/files/kpdf-3.4.3-CAN-2005-3193.patch b/kde-base/kpdf/files/kpdf-3.4.3-CAN-2005-3193.patch
new file mode 100644
index 000000000000..0999fe01cd4e
--- /dev/null
+++ b/kde-base/kpdf/files/kpdf-3.4.3-CAN-2005-3193.patch
@@ -0,0 +1,119 @@
+--- kpdf/xpdf/xpdf/JPXStream.cc.orig 2005-12-04 13:01:07.000000000 +0100
++++ kpdf/xpdf/xpdf/JPXStream.cc 2005-12-04 13:15:44.000000000 +0100
+@@ -666,7 +666,7 @@
+ int segType;
+ GBool haveSIZ, haveCOD, haveQCD, haveSOT;
+ Guint precinctSize, style;
+- Guint segLen, capabilities, comp, i, j, r;
++ Guint segLen, capabilities, nTiles, comp, i, j, r;
+
+ //----- main header
+ haveSIZ = haveCOD = haveQCD = haveSOT = gFalse;
+@@ -701,6 +701,13 @@
+ / img.xTileSize;
+ img.nYTiles = (img.ySize - img.yTileOffset + img.yTileSize - 1)
+ / img.yTileSize;
++ nTiles = img.nXTiles * img.nYTiles;
++ // check for overflow before allocating memory
++ if (nTiles == 0 || nTiles / img.nXTiles != img.nYTiles) {
++ error(getPos(), "Bad tile count in JPX SIZ marker segment");
++ return gFalse;
++ }
++ img.tiles = (JPXTile *)gmalloc(nTiles * sizeof(JPXTile));
+ img.tiles = (JPXTile *)gmalloc(img.nXTiles * img.nYTiles *
+ sizeof(JPXTile));
+ for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
+--- kpdf/xpdf/xpdf/Stream.h.orig 2005-12-04 13:16:13.000000000 +0100
++++ kpdf/xpdf/xpdf/Stream.h 2005-12-04 13:21:52.000000000 +0100
+@@ -233,6 +233,8 @@
+
+ ~StreamPredictor();
+
++ GBool isOk() { return ok; }
++
+ int lookChar();
+ int getChar();
+
+@@ -250,6 +252,7 @@
+ int rowBytes; // bytes per line
+ Guchar *predLine; // line buffer
+ int predIdx; // current index in predLine
++ GBool ok;
+ };
+
+ //------------------------------------------------------------------------
+--- kpdf/xpdf/xpdf/Stream.cc.orig 2005-12-04 13:23:51.000000000 +0100
++++ kpdf/xpdf/xpdf/Stream.cc 2005-12-04 13:36:34.000000000 +0100
+@@ -408,18 +408,34 @@
+
+ StreamPredictor::StreamPredictor(Stream *strA, int predictorA,
+ int widthA, int nCompsA, int nBitsA) {
++ int totalBits;
++
+ str = strA;
+ predictor = predictorA;
+ width = widthA;
+ nComps = nCompsA;
+ nBits = nBitsA;
++ predLine = NULL;
++ ok = gFalse;
++
+
+ nVals = width * nComps;
++ totalBits = nVals * nBits;
++ if (totalBits == 0 ||
++ (totalBits / nBits) / nComps != width ||
++ totalBits + 7 < 0) {
++ return;
++ }
+ pixBytes = (nComps * nBits + 7) >> 3;
+- rowBytes = ((nVals * nBits + 7) >> 3) + pixBytes;
++ rowBytes = ((totalBits + 7) >> 3) + pixBytes;
++ if (rowBytes < 0) {
++ return;
++ }
+ predLine = (Guchar *)gmalloc(rowBytes);
+ memset(predLine, 0, rowBytes);
+ predIdx = rowBytes;
++
++ ok = gTrue;
+ }
+
+ StreamPredictor::~StreamPredictor() {
+@@ -1013,6 +1029,10 @@
+ FilterStream(strA) {
+ if (predictor != 1) {
+ pred = new StreamPredictor(this, predictor, columns, colors, bits);
++ if (!pred->isOk()) {
++ delete pred;
++ pred = NULL;
++ }
+ } else {
+ pred = NULL;
+ }
+@@ -2899,6 +2919,14 @@
+ height = read16();
+ width = read16();
+ numComps = str->getChar();
++ if (numComps <= 0 || numComps > 4) {
++ error(getPos(), "Bad number of components in DCT stream", prec);
++ return gFalse;
++ }
++ if (numComps <= 0 || numComps > 4) {
++ error(getPos(), "Bad number of components in DCT stream", prec);
++ return gFalse;
++ }
+ if (prec != 8) {
+ error(getPos(), "Bad DCT precision %d", prec);
+ return gFalse;
+@@ -3258,6 +3286,10 @@
+ FilterStream(strA) {
+ if (predictor != 1) {
+ pred = new StreamPredictor(this, predictor, columns, colors, bits);
++ if (!pred->isOk()) {
++ delete pred;
++ pred = NULL;
++ }
+ } else {
+ pred = NULL;
+ }
diff --git a/kde-base/kpdf/files/kpdf-3.5.0-CAN-2005-3193.patch b/kde-base/kpdf/files/kpdf-3.5.0-CAN-2005-3193.patch
new file mode 100644
index 000000000000..f171b12cf5ce
--- /dev/null
+++ b/kde-base/kpdf/files/kpdf-3.5.0-CAN-2005-3193.patch
@@ -0,0 +1,118 @@
+--- kpdf/xpdf/xpdf/JPXStream.cc 2005/12/01 22:32:29 484786
++++ kpdf/xpdf/xpdf/JPXStream.cc 2005/12/01 22:34:41 484787
+@@ -783,7 +783,7 @@
+ int segType;
+ GBool haveSIZ, haveCOD, haveQCD, haveSOT;
+ Guint precinctSize, style;
+- Guint segLen, capabilities, comp, i, j, r;
++ Guint segLen, capabilities, nTiles, comp, i, j, r;
+
+ //----- main header
+ haveSIZ = haveCOD = haveQCD = haveSOT = gFalse;
+@@ -818,6 +818,13 @@
+ / img.xTileSize;
+ img.nYTiles = (img.ySize - img.yTileOffset + img.yTileSize - 1)
+ / img.yTileSize;
++ nTiles = img.nXTiles * img.nYTiles;
++ // check for overflow before allocating memory
++ if (nTiles == 0 || nTiles / img.nXTiles != img.nYTiles) {
++ error(getPos(), "Bad tile count in JPX SIZ marker segment");
++ return gFalse;
++ }
++ img.tiles = (JPXTile *)gmallocn(nTiles, sizeof(JPXTile));
+ img.tiles = (JPXTile *)gmallocn(img.nXTiles * img.nYTiles,
+ sizeof(JPXTile));
+ for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
+--- kpdf/xpdf/xpdf/Stream.h 2005/12/01 22:32:29 484786
++++ kpdf/xpdf/xpdf/Stream.h 2005/12/01 22:34:41 484787
+@@ -232,6 +232,8 @@
+
+ ~StreamPredictor();
+
++ GBool isOk() { return ok; }
++
+ int lookChar();
+ int getChar();
+
+@@ -249,6 +251,7 @@
+ int rowBytes; // bytes per line
+ Guchar *predLine; // line buffer
+ int predIdx; // current index in predLine
++ GBool ok;
+ };
+
+ //------------------------------------------------------------------------
+--- kpdf/xpdf/xpdf/Stream.cc 2005/12/01 22:32:29 484786
++++ kpdf/xpdf/xpdf/Stream.cc 2005/12/01 22:34:41 484787
+@@ -403,18 +403,33 @@
+
+ StreamPredictor::StreamPredictor(Stream *strA, int predictorA,
+ int widthA, int nCompsA, int nBitsA) {
++ int totalBits;
++
+ str = strA;
+ predictor = predictorA;
+ width = widthA;
+ nComps = nCompsA;
+ nBits = nBitsA;
++ predLine = NULL;
++ ok = gFalse;
+
+ nVals = width * nComps;
++ totalBits = nVals * nBits;
++ if (totalBits == 0 ||
++ (totalBits / nBits) / nComps != width ||
++ totalBits + 7 < 0) {
++ return;
++ }
+ pixBytes = (nComps * nBits + 7) >> 3;
+- rowBytes = ((nVals * nBits + 7) >> 3) + pixBytes;
++ rowBytes = ((totalBits + 7) >> 3) + pixBytes;
++ if (rowBytes < 0) {
++ return;
++ }
+ predLine = (Guchar *)gmalloc(rowBytes);
+ memset(predLine, 0, rowBytes);
+ predIdx = rowBytes;
++
++ ok = gTrue;
+ }
+
+ StreamPredictor::~StreamPredictor() {
+@@ -1006,6 +1021,10 @@
+ FilterStream(strA) {
+ if (predictor != 1) {
+ pred = new StreamPredictor(this, predictor, columns, colors, bits);
++ if (!pred->isOk()) {
++ delete pred;
++ pred = NULL;
++ }
+ } else {
+ pred = NULL;
+ }
+@@ -2903,6 +2922,14 @@
+ height = read16();
+ width = read16();
+ numComps = str->getChar();
++ if (numComps <= 0 || numComps > 4) {
++ error(getPos(), "Bad number of components in DCT stream", prec);
++ return gFalse;
++ }
++ if (numComps <= 0 || numComps > 4) {
++ error(getPos(), "Bad number of components in DCT stream", prec);
++ return gFalse;
++ }
+ if (prec != 8) {
+ error(getPos(), "Bad DCT precision %d", prec);
+ return gFalse;
+@@ -3833,6 +3860,10 @@
+ FilterStream(strA) {
+ if (predictor != 1) {
+ pred = new StreamPredictor(this, predictor, columns, colors, bits);
++ if (!pred->isOk()) {
++ delete pred;
++ pred = NULL;
++ }
+ } else {
+ pred = NULL;
+ }
diff --git a/kde-base/kpdf/files/kpdf-3.5.0-splitter-io.patch b/kde-base/kpdf/files/kpdf-3.5.0-splitter-io.patch
new file mode 100644
index 000000000000..82e4311bba5c
--- /dev/null
+++ b/kde-base/kpdf/files/kpdf-3.5.0-splitter-io.patch
@@ -0,0 +1,38 @@
+Index: kpdf/part.cpp
+===================================================================
+--- kpdf/part.cpp (revision 485446)
++++ kpdf/part.cpp (revision 485447)
+@@ -274,6 +274,8 @@
+ connect( m_watcher, SIGNAL( dirty( const QString& ) ), this, SLOT( slotFileDirty( const QString& ) ) );
+ m_dirtyHandler = new QTimer( this );
+ connect( m_dirtyHandler, SIGNAL( timeout() ),this, SLOT( slotDoFileDirty() ) );
++ m_saveSplitterSizeTimer = new QTimer( this );
++ connect( m_saveSplitterSizeTimer, SIGNAL( timeout() ),this, SLOT( saveSplitterSize() ) );
+
+ slotNewConfig();
+
+@@ -478,7 +480,7 @@
+ {
+ // if pageView has been resized, save splitter sizes
+ if ( watched == m_pageView && e->type() == QEvent::Resize )
+- saveSplitterSize();
++ m_saveSplitterSizeTimer->start(500, true);
+
+ // only intercept events, don't block them
+ return false;
+Index: kpdf/part.h
+===================================================================
+--- kpdf/part.h (revision 485446)
++++ kpdf/part.h (revision 485447)
+@@ -146,6 +146,11 @@
+ // static instances counter
+ static unsigned int m_count;
+
++ // this is a hack because we can not use writeConfig on part destructor
++ // and we don't want to writeconfig every time someone moves the splitter
++ // so we use a QTimer each 500 ms
++ QTimer *m_saveSplitterSizeTimer;
++
+ KDirWatch *m_watcher;
+ QTimer *m_dirtyHandler;
+ DocumentViewport m_viewportDirty;