[
https://issues.apache.org/jira/browse/TIKA-1763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14943692#comment-14943692
]
ASF GitHub Bot commented on TIKA-1763:
--------------------------------------
GitHub user jrnorth opened a pull request:
https://github.com/apache/tika/pull/57
Fix for TIKA-1763
-Prevents a StringIndexOutOfBoundsException by checking the result of a
call to lastIndexOf() before using it in a call to substring().
-Adds unit tests.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/jrnorth/tika trunk
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/tika/pull/57.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #57
----
commit 807302f2775d9ee6a6a9f3820665330edc163d88
Author: Joseph North <[email protected]>
Date: 2015-10-05T17:12:54Z
Fix for TIKA-1763
-Prevents a StringIndexOutOfBoundsException by checking the result of a
call to lastIndexOf() before using it in a call to substring().
-Adds unit tests.
----
> StringIndexOutOfBoundsException in ImageMetadataExtractor
> ---------------------------------------------------------
>
> Key: TIKA-1763
> URL: https://issues.apache.org/jira/browse/TIKA-1763
> Project: Tika
> Issue Type: Bug
> Components: parser
> Affects Versions: 1.10
> Reporter: Joseph North
> Priority: Minor
>
> The {{trimPixels(String s)}} method in {{ImageMetadataExtractor}} will throw
> a {{StringIndexOutOfBoundsException}} if the string passed to it doesn't
> contain the substring " pixels". The method does a {{lastIndexOf(" pixels")}}
> call on the string passed to it and uses the result directly in a
> {{substring()}} call without checking whether the result is greater than -1.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)