You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Andreas Lehmkühler (JIRA)" <ji...@apache.org> on 2014/04/20 14:28:16 UTC
[jira] [Closed] (PDFBOX-1883) Avoid StringIndexOutOfBoundsException
in DateConverter
[ https://issues.apache.org/jira/browse/PDFBOX-1883?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andreas Lehmkühler closed PDFBOX-1883.
--------------------------------------
Resolution: Duplicate
Fix Version/s: (was: 1.8.5)
Reopened to remove the fix version, closed again
> Avoid StringIndexOutOfBoundsException in DateConverter
> ------------------------------------------------------
>
> Key: PDFBOX-1883
> URL: https://issues.apache.org/jira/browse/PDFBOX-1883
> Project: PDFBox
> Issue Type: Bug
> Components: PDModel
> Affects Versions: 1.8.4
> Reporter: Tim Allison
> Assignee: Andreas Lehmkühler
> Priority: Trivial
> Labels: easyfix
> Attachments: PDFBOX-1883.patch
>
>
> Passing an empty string to parseDate can result in an ArrayIndexOutOfBoundsException.
> Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 0
> at java.lang.String.charAt(Unknown Source)
> at org.apache.pdfbox.util.DateConverter.parseDate(DateConverter.java:680)
> at org.apache.pdfbox.util.DateConverter.toCalendar(DateConverter.java:808)
> at org.apache.pdfbox.util.DateConverter.toCalendar(DateConverter.java:780)
> at org.apache.pdfbox.util.DateConverter.toCalendar(DateConverter.java:754)
> at org.apache.pdfbox.cos.COSDictionary.getDate(COSDictionary.java:797)
> at org.apache.pdfbox.pdmodel.PDDocumentInformation.getCreationDate(PDDocumentInformation.java:210)
> at org.apache.tika.parser.pdf.PDFParser.extractMetadata(PDFParser.java:170)
> at org.apache.tika.parser.pdf.PDFParser.parse(PDFParser.java:142)
> at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:242)
> I can't share the triggering document, but I'll submit patch with test case shortly.
--
This message was sent by Atlassian JIRA
(v6.2#6252)