[
https://issues.apache.org/jira/browse/PDFBOX-1883?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13896143#comment-13896143
]
Fred Hansen commented on PDFBOX-1883:
-------------------------------------
1803 is still open because no committer has yet gotten around to incorporating
the patch there.
A key question is whether that patch would resolve your problem. If so, you
should vote to 1803. If not, please let me know what about the behavior should
change.
Thanks, Fred Hansen
> 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
> Priority: Trivial
> Labels: easyfix
> Fix For: 1.8.5
>
> 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.1.5#6160)