mirror of
https://github.com/Qortal/AT.git
synced 2025-01-30 02:42:14 +00:00
Correct bounds check in FunctionCode.getHashData()
The test "functionData.value2 > state.numDataPages" was incorrect because value2 contains a a BYTE count, so could be up to 8 times bigger than state.numDataPages! Reverted back to looser check of "functionData.value2 > Integer.MAX_VALUE"
This commit is contained in:
parent
b0370cc52d
commit
aadf987514
@ -1083,7 +1083,7 @@ public enum FunctionCode {
|
||||
checkDataAddress(state, functionData.value1, 1);
|
||||
|
||||
// Validate data length in arg2
|
||||
if (functionData.value2 < 0L || functionData.value2 > state.numDataPages || functionData.value1 + byteLengthToDataLength(functionData.value2) > state.numDataPages)
|
||||
if (functionData.value2 < 0L || functionData.value2 > Integer.MAX_VALUE || functionData.value1 + byteLengthToDataLength(functionData.value2) > state.numDataPages)
|
||||
throw new ExecutionException(this.name() + " data length invalid");
|
||||
|
||||
final int dataStart = (int) (functionData.value1 & Integer.MAX_VALUE);
|
||||
|
Loading…
Reference in New Issue
Block a user