summaryrefslogtreecommitdiff
path: root/graphics/kdegraphics3/patches/patch-ae
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/kdegraphics3/patches/patch-ae')
-rw-r--r--graphics/kdegraphics3/patches/patch-ae30
1 files changed, 30 insertions, 0 deletions
diff --git a/graphics/kdegraphics3/patches/patch-ae b/graphics/kdegraphics3/patches/patch-ae
new file mode 100644
index 00000000000..cd77c9347f6
--- /dev/null
+++ b/graphics/kdegraphics3/patches/patch-ae
@@ -0,0 +1,30 @@
+$NetBSD: patch-ae,v 1.3 2010/10/25 19:30:04 markd Exp $
+
+Fix for CVE-2010-3704
+
+--- kpdf/xpdf/fofi/FoFiType1.cc.orig 2007-05-14 07:39:30.000000000 +0000
++++ kpdf/xpdf/fofi/FoFiType1.cc
+@@ -18,6 +18,14 @@
+ #include "FoFiEncodings.h"
+ #include "FoFiType1.h"
+
++#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
++# define likely(x) __builtin_expect((x), 1)
++# define unlikely(x) __builtin_expect((x), 0)
++#else
++# define likely(x) (x)
++# define unlikely(x) (x)
++#endif
++
+ //------------------------------------------------------------------------
+ // FoFiType1
+ //------------------------------------------------------------------------
+@@ -224,7 +232,7 @@ void FoFiType1::parse() {
+ code = code * 8 + (*p2 - '0');
+ }
+ }
+- if (code < 256) {
++ if (likely(code < 256 && code >= 0)) {
+ for (p = p2; *p == ' ' || *p == '\t'; ++p) ;
+ if (*p == '/') {
+ ++p;