pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r1861588 - in /pdfbox/branches/2.0: ./ fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java pdfbox/
Date Tue, 18 Jun 2019 16:20:59 GMT
Author: lehmi
Date: Tue Jun 18 16:20:59 2019
New Revision: 1861588

URL: http://svn.apache.org/viewvc?rev=1861588&view=rev
Log:
PDFBOX-4550: don't skip bfranges with more than 255 array elements

Modified:
    pdfbox/branches/2.0/   (props changed)
    pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java
    pdfbox/branches/2.0/pdfbox/   (props changed)

Propchange: pdfbox/branches/2.0/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jun 18 16:20:59 2019
@@ -1,3 +1,4 @@
+/pdfbox/branches/issue4569:1861285,1861586
 /pdfbox/branches/no-awt:1618517-1621410
 /pdfbox/no-awt:1618514-1618516
 /pdfbox/trunk:1736223,1736227,1736615,1737043,1737130,1737599-1737600,1738755,1740160,1742437,1742442,1743248,1745595,1745606,1745772,1745774,1745776,1745779,1746032,1746151,1749162,1749165,1749432,1766088,1766213,1767585,1768061,1770985,1770988,1772528,1778172,1782679,1786586,1786603,1787546,1789414,1790745,1794073,1794090,1794620,1794753,1794859,1794891,1800566,1812426,1814226,1826836,1857800,1857803,1857914

Modified: pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java?rev=1861588&r1=1861587&r2=1861588&view=diff
==============================================================================
--- pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java (original)
+++ pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java Tue
Jun 18 16:20:59 2019
@@ -365,8 +365,7 @@ public class CMapParser
             int start = CMap.toInt(startCode, startCode.length);
             int end = CMap.toInt(endCode, endCode.length);
             // end has to be bigger than start or equal
-            // the range can not represent more that 255 values
-            if (end < start || (end - start) > 255)
+            if (end < start)
             {
                 // PDFBOX-4550: likely corrupt stream
                 break;
@@ -384,6 +383,12 @@ public class CMapParser
             // PDFBOX-3807: ignore null
             else if (nextToken instanceof byte[])
             {
+                // the range can not represent more that 255 values
+                if ((end - start) > 255)
+                {
+                    // PDFBOX-4550: likely corrupt stream
+                    break;
+                }
                 byte[] tokenBytes = (byte[]) nextToken;
                 // PDFBOX-3450: ignore <>
                 if (tokenBytes.length > 0)

Propchange: pdfbox/branches/2.0/pdfbox/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jun 18 16:20:59 2019
@@ -1,3 +1,4 @@
+/pdfbox/branches/issue4569/pdfbox:1861285
 /pdfbox/branches/no-awt/pdfbox:1618517-1621410
 /pdfbox/no-awt/pdfbox:1618514-1618516
 /pdfbox/trunk/pdfbox:1736223,1736227,1736615,1737043,1737130,1737599-1737600,1738755,1740160,1742437,1742442,1743248,1745595,1745606,1745772,1745774,1745776,1745779,1746032,1746151,1749162,1749165,1749432,1757165,1758817,1767585,1768061,1770988,1772528,1778172,1782679,1786586,1786603,1787546,1789414,1790745,1794073,1794090,1794620,1794753,1794859,1794891,1812426,1814226,1826836,1857800,1857803,1857914,1859664,1859686



Mime
View raw message