You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "John Hewson (JIRA)" <ji...@apache.org> on 2014/03/14 22:30:46 UTC

[jira] [Reopened] (PDFBOX-1946) Running within an Applet has many AccessControlException 's

     [ https://issues.apache.org/jira/browse/PDFBOX-1946?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John Hewson reopened PDFBOX-1946:
---------------------------------


I've encountered a case where this fix masks a bug in PDFBox. In PDFBOX-1988 a bug causes the font in PDFStreamEngine to be null, which should cause an NPE, causing the user to file a bug report. In 1.8.4 this happens, but in 1.8.5 and 2.0 it does not, because it's been wrapped with if (font != null) so the NPE is silently swallowed.

We need to find some other way of fixing the null font issue, identifying exactly why it is null in an applet and perhaps just substituting a default font such as PDType1.HELVETICA so that null remains an invalid value. I've removed the fix from PDFStreamEngine in revision 1577725 in trunk and 1577728 in 1.8, and am re-opening this issue.

> Running within an Applet has many AccessControlException 's
> -----------------------------------------------------------
>
>                 Key: PDFBOX-1946
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1946
>             Project: PDFBox
>          Issue Type: Wish
>    Affects Versions: 1.8.4
>         Environment: Running within an Applet
>            Reporter: Fred Andrews
>              Labels: Security
>             Fix For: 1.8.5, 2.0.0
>
>         Attachments: patch.zip
>
>
> I've identified 6 modules that should be modified to avoid AccessControlException's while running within an Applet.  My solution would be to catch each AccessControlException and then use a default or continue on.  For most of these, that is probably the best solution, for a few especially PDFStreamEngine someone may have a better idea.
> The modules that have issues:
> pdfbox\pdfparser\BaseParser -- line 131 call to Boolean.getBoolean, line 170 call to Integer.getInteger
> pdfbox\util\PDFTextStripper -- line 79 call to System.getProperty()
> pdfbox\util\ResourceLoader -- line 67 call to getSystemClassLoader()
> pdfbox\pdmodel\graphics\color\PDColorState -- line 50, call to Color.getColor
> pdfbox/encoding/Encoding -- line 78, call to System.getProperty
> pdfbox\util\PDFStreamEngine -- Line 351 & 364 check for font == null (will be null if had resource loading problems)
> Not sure what the best way is to proceed.  Please advise.
> Thanks



--
This message was sent by Atlassian JIRA
(v6.2#6252)