mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2024-11-20 02:09:29 +01:00
Fix bug revealed by static analysis.
This commit is contained in:
parent
f5216b1d49
commit
18dd2e2b05
@ -87,7 +87,7 @@ public class ScriptChunk {
|
|||||||
byte b = data[0];
|
byte b = data[0];
|
||||||
if (b >= 0x01 && b <= 0x10)
|
if (b >= 0x01 && b <= 0x10)
|
||||||
return opcode == OP_1 + b - 1;
|
return opcode == OP_1 + b - 1;
|
||||||
if (b == 0x81)
|
if ((b & 0xFF) == 0x81)
|
||||||
return opcode == OP_1NEGATE;
|
return opcode == OP_1NEGATE;
|
||||||
}
|
}
|
||||||
if (data.length < OP_PUSHDATA1)
|
if (data.length < OP_PUSHDATA1)
|
||||||
@ -106,7 +106,6 @@ public class ScriptChunk {
|
|||||||
checkState(data == null);
|
checkState(data == null);
|
||||||
stream.write(opcode);
|
stream.write(opcode);
|
||||||
} else if (data != null) {
|
} else if (data != null) {
|
||||||
checkNotNull(data);
|
|
||||||
if (opcode < OP_PUSHDATA1) {
|
if (opcode < OP_PUSHDATA1) {
|
||||||
checkState(data.length == opcode);
|
checkState(data.length == opcode);
|
||||||
stream.write(opcode);
|
stream.write(opcode);
|
||||||
|
Loading…
Reference in New Issue
Block a user