You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "Tim Allison (Jira)" <ji...@apache.org> on 2020/04/19 13:47:00 UTC
[jira] [Resolved] (TIKA-3080) CharsetMatch.getString can get stuck
in infinite loop
[ https://issues.apache.org/jira/browse/TIKA-3080?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tim Allison resolved TIKA-3080.
-------------------------------
Fix Version/s: 1.24.1
Resolution: Fixed
Y. Thank you Tilman!
> CharsetMatch.getString can get stuck in infinite loop
> -----------------------------------------------------
>
> Key: TIKA-3080
> URL: https://issues.apache.org/jira/browse/TIKA-3080
> Project: Tika
> Issue Type: Bug
> Components: parser
> Affects Versions: 1.24
> Reporter: Vikram Shrowty
> Priority: Major
> Fix For: 1.24.1
>
>
> In here:
> [https://github.com/apache/tika/blob/fb5a191edac2cef28c0a4ac390c9156acdc9e673/tika-parsers/src/main/java/org/apache/tika/parser/txt/CharsetMatch.java#L147-L150]
> If you specify a maxLength and the stream is long enough, the max variable in the loop goes to zero and the loop then gets stuck because you're asking to read 0 bytes but not exiting unless the number of bytes read is < 0.
> Looks like the condition ought to be > 0 instead of >= 0.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)