You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Emmanuel Bourg (JIRA)" <ji...@apache.org> on 2014/04/24 10:29:20 UTC

[jira] [Updated] (BCEL-125) Incorrect size calculation in InstructionFinder

     [ https://issues.apache.org/jira/browse/BCEL-125?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Bourg updated BCEL-125:
--------------------------------

         Priority: Blocker
      Environment:     (was: Operating System: Windows XP
Platform: PC)
    Fix Version/s: 6.0

> Incorrect size calculation in InstructionFinder
> -----------------------------------------------
>
>                 Key: BCEL-125
>                 URL: https://issues.apache.org/jira/browse/BCEL-125
>             Project: Commons BCEL
>          Issue Type: Bug
>          Components: Main
>    Affects Versions: 5.2
>            Reporter: Nebojsa Grujic
>            Assignee: Apache Commons Developers
>            Priority: Blocker
>             Fix For: 6.0
>
>
> In InstructionFinder class, line 229 size of the matched pattern is calculated as
> int lenExpr = (endExpr - startExpr) + 1;
> this is incorrect as endExpr is always given as one past the last index and this function causes the iterator being returned to always have one more instruction then requested. Also this can cause a crash if the pattern requested is at the end of a search list as index goes out of bounds.
> suggested fix (I have it working locally with no problems):
> int lenExpr = (endExpr - startExpr);



--
This message was sent by Atlassian JIRA
(v6.2#6252)