You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "Tyler Palsulich (JIRA)" <ji...@apache.org> on 2015/03/02 02:49:04 UTC
[jira] [Commented] (TIKA-788) DWG parser infinite loop on possibly
corrupt file
[ https://issues.apache.org/jira/browse/TIKA-788?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14342609#comment-14342609 ]
Tyler Palsulich commented on TIKA-788:
--------------------------------------
[~seegler], it looks like your stack trace is related to parsing an mp3 file.
Does anyone have a dwg file that triggers this error? Ideally, they would also have the set of Metadata values extracted by AutoCAD.
> DWG parser infinite loop on possibly corrupt file
> -------------------------------------------------
>
> Key: TIKA-788
> URL: https://issues.apache.org/jira/browse/TIKA-788
> Project: Tika
> Issue Type: Bug
> Components: parser
> Affects Versions: 1.0
> Reporter: Stas Shaposhnikov
>
> When parsing some dwg items, it is possible that the parser may cause itself to go into an infinite loop.
> Attached is the file causing the problem.
> Here is a possible patch that will at least proceed until an error is thrown.
> {noformat}
> === modified file 'tika-parsers/src/main/java/org/apache/tika/parser/dwg/DWGParser.java'
> --- tika-parsers/src/main/java/org/apache/tika/parser/dwg/DWGParser.java 2011-11-24 11:30:33 +0000
> +++ tika-parsers/src/main/java/org/apache/tika/parser/dwg/DWGParser.java 2011-11-25 05:27:41 +0000
> @@ -274,8 +274,10 @@
> return false;
> }
> while (toSkip > 0) {
> - byte[] skip = new byte[Math.min((int) toSkip, 0x4000)];
> - IOUtils.readFully(stream, skip);
> + byte[] skip = new byte[(int) Math.min(toSkip, 0x4000)];
> + if (IOUtils.readFully(stream, skip) == -1) {
> + return false; //invalid skip
> + }
> toSkip -= skip.length;
> }
> return true;
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)