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

Reply via email to