[
https://issues.apache.org/jira/browse/BCEL-14?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Emmanuel Bourg updated BCEL-14:
-------------------------------
Priority: Major
Environment: (was: Operating System: All
Platform: All)
Affects Version/s: (was: unspecified)
Fix Version/s: 5.2
Priority: (was: P3)
Severity: (was: normal)
> Size of LDC_W's operand can be incorrect
> ----------------------------------------
>
> Key: BCEL-14
> URL: https://issues.apache.org/jira/browse/BCEL-14
> Project: Commons BCEL
> Issue Type: Bug
> Components: Main
> Reporter: Hideaki Nobata
> Assignee: Apache Commons Developers
> Fix For: 5.2
>
> Attachments: patch
>
>
> When MethodGen read LDC_W whose index is less than 256 and dumps it, the size
> of
> its operand becomes incorrect.
> LDC_W's setIndex method can change both the opcode and the length.
> But after the invocation initFromFile method change the opcode OR the length.
> And its dump method determines the operand's size by the length.
> As a result that can make a mismatch b/w an opcode and an operand.
> LDC_W.java 1.1.1.1 and 1.3 has this problem.
> A scenario(in case of LDC_W.java 1.3):
> 1. Suppose a LDC_W whose index is less than 256
> 2. initFromFile method sets the opcode to LDC_W and the length to 2.
> 3. dump method writes a LDC_W but it writes a byte as the operand.
> I think that 1.2 has no problem.
> Another solution is as follows.
> --- LDC_W.java.1.1.1.1 Sat Dec 15 21:40:41 2001
> +++ LDC_W.java Wed Mar 26 00:36:01 2003
> @@ -82,6 +82,6 @@
> throws IOException
> {
> setIndex(bytes.readUnsignedShort());
> - length = 3;
> + //length = 3;
> }
> }
--
This message was sent by Atlassian JIRA
(v6.2#6252)