mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
script: prevent UB when computing abs value for num opcode serialize
This commit is contained in:
@@ -129,10 +129,6 @@ void test_one_input(const std::vector<uint8_t>& buffer)
|
||||
break;
|
||||
}
|
||||
(void)script_num.getint();
|
||||
// Avoid negation failure:
|
||||
// script/script.h:332:35: runtime error: negation of -9223372036854775808 cannot be represented in type 'int64_t' (aka 'long'); cast to an unsigned type to negate this value to itself
|
||||
if (script_num != CScriptNum{std::numeric_limits<int64_t>::min()}) {
|
||||
(void)script_num.getvch();
|
||||
}
|
||||
(void)script_num.getvch();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user