pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1715542 - /pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/pfb/PfbParser.java
Date Sat, 21 Nov 2015 16:16:38 GMT
Author: tilman
Date: Sat Nov 21 16:16:38 2015
New Revision: 1715542

URL: http://svn.apache.org/viewvc?rev=1715542&view=rev
Log:
PDFBOX-3126: avoid IndexOutOfBoundsException

Modified:
    pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/pfb/PfbParser.java

Modified: pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/pfb/PfbParser.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/pfb/PfbParser.java?rev=1715542&r1=1715541&r2=1715542&view=diff
==============================================================================
--- pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/pfb/PfbParser.java (original)
+++ pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/pfb/PfbParser.java Sat Nov 21 16:16:38
2015
@@ -141,6 +141,10 @@ public class PfbParser
             size += in.read() << 16;
             size += in.read() << 24;
             lengths[records] = size;
+            if (pointer >= pfbdata.length)
+            {
+                throw new EOFException("attempted to read past EOF");
+            }
             int got = in.read(pfbdata, pointer, size);
             if (got < 0) 
             {



Mime
View raw message