diff options
author | drochner <drochner@pkgsrc.org> | 2007-08-02 14:41:18 +0000 |
---|---|---|
committer | drochner <drochner@pkgsrc.org> | 2007-08-02 14:41:18 +0000 |
commit | cf307199f5795d555fe94ab9ef8321ce7e1e3940 (patch) | |
tree | 4243d031eb744eb78c45b6debb9a2a88269fa6bb /print/poppler/patches | |
parent | 84c70d3fddf9acf012a9256117d7795f4b2b5528 (diff) | |
download | pkgsrc-cf307199f5795d555fe94ab9ef8321ce7e1e3940.tar.gz |
apply a patch from xpdf to fix an integer overflow vulnerability
(CVE-2007-3387)
bump PKGREVISION
Diffstat (limited to 'print/poppler/patches')
-rw-r--r-- | print/poppler/patches/patch-af | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/print/poppler/patches/patch-af b/print/poppler/patches/patch-af new file mode 100644 index 00000000000..757924ba8df --- /dev/null +++ b/print/poppler/patches/patch-af @@ -0,0 +1,30 @@ +$NetBSD: patch-af,v 1.1 2007/08/02 14:41:19 drochner Exp $ + +--- poppler/Stream.cc.orig 2007-08-02 10:28:59.000000000 +0200 ++++ poppler/Stream.cc +@@ -422,12 +422,6 @@ StreamPredictor::StreamPredictor(Stream + ok = gFalse; + + nVals = width * nComps; +- if (width <= 0 || nComps <= 0 || nBits <= 0 || +- nComps >= INT_MAX/nBits || +- width >= INT_MAX/nComps/nBits || +- nVals * nBits + 7 < 0) { +- return; +- } + totalBits = nVals * nBits; + if (totalBits == 0 || + (totalBits / nBits) / nComps != width || +@@ -436,7 +430,11 @@ StreamPredictor::StreamPredictor(Stream + } + pixBytes = (nComps * nBits + 7) >> 3; + rowBytes = ((totalBits + 7) >> 3) + pixBytes; +- if (rowBytes < 0) { ++ if (width <= 0 || nComps <= 0 || nBits <= 0 || ++ nComps > gfxColorMaxComps || ++ nBits > 16 || ++ width >= INT_MAX / nComps || // check for overflow in nVals ++ nVals >= (INT_MAX - 7) / nBits) { // check for overflow in rowBytes + return; + } + predLine = (Guchar *)gmalloc(rowBytes); |