[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE_3_3_BRANCH: kdegraphics/kpdf/xpdf
From:       Dirk Mueller <mueller () kde ! org>
Date:       2004-12-22 12:05:50
Message-ID: 20041222120550.DEF261C51F () office ! kde ! org
[Download RAW message or body]

CVS commit by mueller: 

fix xpdf buffer overflow


  M +3 -1      Gfx.cc   1.4.4.2
  M +6 -1      GfxState.cc   1.3.4.2


--- kdegraphics/kpdf/xpdf/Gfx.cc  #1.4.4.1:1.4.4.2
@@ -2655,5 +2655,7 @@ void Gfx::doImage(Object *ref, Stream *s
     dict->lookup("Mask", &maskObj);
     if (maskObj.isArray()) {
-      for (i = 0; i < maskObj.arrayGetLength(); ++i) {
+      for (i = 0;
+           i < maskObj.arrayGetLength() && i < 2*gfxColorMaxComps;
+           ++i) {
         maskObj.arrayGet(i, &obj1);
         maskColors[i] = obj1.getInt();

--- kdegraphics/kpdf/xpdf/GfxState.cc  #1.3.4.1:1.3.4.2
@@ -709,4 +709,9 @@ GfxColorSpace *GfxICCBasedColorSpace::pa
   nCompsA = obj2.getInt();
   obj2.free();
+  if (nCompsA > gfxColorMaxComps) {
+    error(-1, "ICCBased color space with too many (%d > %d) components",
+          nCompsA, gfxColorMaxComps);
+    nCompsA = gfxColorMaxComps;
+  }
   if (dict->lookup("Alternate", &obj2)->isNull() ||
       !(altA = GfxColorSpace::parse(&obj2))) {
@@ -1055,5 +1060,5 @@ GfxColorSpace *GfxDeviceNColorSpace::par
   nCompsA = obj1.arrayGetLength();
   if (nCompsA > gfxColorMaxComps) {
-    error(-1, "DeviceN color space with more than %d > %d components",
+    error(-1, "DeviceN color space with too many (%d > %d) components",
           nCompsA, gfxColorMaxComps);
     nCompsA = gfxColorMaxComps;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic