pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lauri.laa...@heeros.com
Subject NullPointerException in org.apache.fontbox.ttf.PostScriptTable.getName - how to submit fix?
Date Thu, 22 Jun 2017 11:13:11 GMT
Hi all,

I received the following error (v 2.0.6)

java.lang.ArrayIndexOutOfBoundsException: 4
at 
org.apache.fontbox.ttf.PostScriptTable.getName(PostScriptTable.java:318)
at 
org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.readEncodingFromFont(PDTrueTypeFont.java:260)
at 
org.apache.pdfbox.pdmodel.font.PDSimpleFont.readEncoding(PDSimpleFont.java:134)
at 
org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.<init>(PDTrueTypeFont.java:209)
at 
org.apache.pdfbox.pdmodel.font.PDFontFactory.createFont(PDFontFactory.java:75)
at org.apache.pdfbox.pdmodel.PDResources.getFont(PDResources.java:143) 


Investigating the function in question:

public String getName(int gid)
313         {
314             if (gid < 0 || glyphNames == null || gid > 
glyphNames.length)
315             {
316                 return null;
317             }
318             return glyphNames[gid];
319         }



I think that the check on line 314 should be : 

gid < 0 || glyphNames == null || gid >= glyphNames.length

Otherwise, when gid == glyphNames.length there will be AIOOB.

How do I submit this small fix?


Thanks in advance,



-Lauri Laanti

-- 
Lauri Laanti
Pääarkkitehti / Head Architect
Heeros Oyj
Hitsaajankatu 20, 00810 Helsinki

tel: +358 40 755 4812
email: lauri.laanti@heeros.com
skype: lauri.laanti.heeros
web: http://www.heeros.com/

Heeroksen asiakasmatka Riikaan 24.-25.8.2017. Ilmoittaudu mukaan!


Facebook |  LinkedIn




Mime
  • Unnamed multipart/related (inline, None, 0 bytes)
View raw message