Bugzilla – Attachment 59935 Details for
Bug 137156
VUL-0: CVE-2005-3193: xpdf: overflows
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
patch for 2.02 from redhat
xpdf-2.02-CAN-2005-3193.patch (text/plain), 2.35 KB, created by
Dirk Mueller
on 2005-12-06 16:56:40 UTC
(
hide
)
Description:
patch for 2.02 from redhat
Filename:
MIME Type:
Creator:
Dirk Mueller
Created:
2005-12-06 16:56:40 UTC
Size:
2.35 KB
patch
obsolete
>--- xpdf-2.02/xpdf/Stream.cc.orig 2005-11-17 14:51:27.000000000 +0100 >+++ xpdf-2.02/xpdf/Stream.cc 2005-11-17 14:58:36.000000000 +0100 >@@ -404,18 +404,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() { >@@ -981,6 +996,10 @@ > FilterStream(strA) { > if (predictor != 1) { > pred = new StreamPredictor(this, predictor, columns, colors, bits); >+ if (!pred->isOk()) { >+ delete pred; >+ pred = NULL; >+ } > } else { > pred = NULL; > } >@@ -2864,6 +2883,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; >@@ -3182,6 +3209,10 @@ > FilterStream(strA) { > if (predictor != 1) { > pred = new StreamPredictor(this, predictor, columns, colors, bits); >+ if (!pred->isOk()) { >+ delete pred; >+ pred = NULL; >+ } > } else { > pred = NULL; > } >--- xpdf-2.02/xpdf/Stream.h.orig 2005-11-17 14:58:46.000000000 +0100 >+++ xpdf-2.02/xpdf/Stream.h 2005-11-17 14:59:25.000000000 +0100 >@@ -225,6 +225,8 @@ > > ~StreamPredictor(); > >+ GBool isOk() { return ok; } >+ > int lookChar(); > int getChar(); > >@@ -242,6 +244,7 @@ > int rowBytes; // bytes per line > Guchar *predLine; // line buffer > int predIdx; // current index in predLine >+ GBool ok; > }; > > //------------------------------------------------------------------------
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 137156
:
59932
|
59935
|
60106
|
60190
|
60194
|
60264
|
60265
|
60405
|
60994
|
60995
|
60998
|
62964