pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1859322 - /pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java
Date Wed, 15 May 2019 19:50:04 GMT
Author: tilman
Date: Wed May 15 19:50:04 2019
New Revision: 1859322

URL: http://svn.apache.org/viewvc?rev=1859322&view=rev
Log:
PDFBOX-4550: don't bother with corrupt stream

Modified:
    pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java

Modified: pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java?rev=1859322&r1=1859321&r2=1859322&view=diff
==============================================================================
--- pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java (original)
+++ pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java Wed May 15
19:50:04 2019
@@ -356,6 +356,11 @@ public class CMapParser
             }
             byte[] startCode = (byte[]) nextToken;
             byte[] endCode = (byte[]) parseNextToken(cmapStream);
+            if (startCode.length != endCode.length)
+            {
+                // PDFBOX-4550: likely corrupt stream
+                continue;
+            }
             nextToken = parseNextToken(cmapStream);
             List<byte[]> array = null;
             byte[] tokenBytes;



Mime
View raw message