[ 
https://issues.apache.org/jira/browse/TIKA-3080?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17078437#comment-17078437
 ] 

Hudson commented on TIKA-3080:
------------------------------

UNSTABLE: Integrated in Jenkins build tika-branch-1x #330 (See 
[https://builds.apache.org/job/tika-branch-1x/330/])
TIKA-3080 -- prevent infinite loop in CharsetMatch.getString (tallison: 
[https://github.com/apache/tika/commit/73b26ef0569039157ff146f97c0f279938b2bfaa])
* (edit) tika-parsers/src/main/java/org/apache/tika/parser/txt/CharsetMatch.java


> 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
>
> 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)

Reply via email to