mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 18:53:23 -03:00
fuzz: add missing overrides to signature_checker
and also - add missing parentheses in fuzz/scriptnum_ops.cpp - remove useless unsigned int conditional in fuzz/script.cpp These changes fix 5 compile warnings in gcc 10.
This commit is contained in:
parent
090d877160
commit
c0f09c2c9d
3 changed files with 5 additions and 5 deletions
|
@ -48,7 +48,7 @@ void test_one_input(const std::vector<uint8_t>& buffer)
|
||||||
if (CompressScript(script, compressed)) {
|
if (CompressScript(script, compressed)) {
|
||||||
const unsigned int size = compressed[0];
|
const unsigned int size = compressed[0];
|
||||||
compressed.erase(compressed.begin());
|
compressed.erase(compressed.begin());
|
||||||
assert(size >= 0 && size <= 5);
|
assert(size <= 5);
|
||||||
CScript decompressed_script;
|
CScript decompressed_script;
|
||||||
const bool ok = DecompressScript(decompressed_script, size, compressed);
|
const bool ok = DecompressScript(decompressed_script, size, compressed);
|
||||||
assert(ok);
|
assert(ok);
|
||||||
|
|
|
@ -33,7 +33,7 @@ void test_one_input(const std::vector<uint8_t>& buffer)
|
||||||
case 0: {
|
case 0: {
|
||||||
const int64_t i = fuzzed_data_provider.ConsumeIntegral<int64_t>();
|
const int64_t i = fuzzed_data_provider.ConsumeIntegral<int64_t>();
|
||||||
assert((script_num == i) != (script_num != i));
|
assert((script_num == i) != (script_num != i));
|
||||||
assert((script_num <= i) != script_num > i);
|
assert((script_num <= i) != (script_num > i));
|
||||||
assert((script_num >= i) != (script_num < i));
|
assert((script_num >= i) != (script_num < i));
|
||||||
// Avoid signed integer overflow:
|
// Avoid signed integer overflow:
|
||||||
// script/script.h:264:93: runtime error: signed integer overflow: -2261405121394637306 + -9223372036854775802 cannot be represented in type 'long'
|
// script/script.h:264:93: runtime error: signed integer overflow: -2261405121394637306 + -9223372036854775802 cannot be represented in type 'long'
|
||||||
|
|
|
@ -28,17 +28,17 @@ public:
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool CheckSig(const std::vector<unsigned char>& scriptSig, const std::vector<unsigned char>& vchPubKey, const CScript& scriptCode, SigVersion sigversion) const
|
bool CheckSig(const std::vector<unsigned char>& scriptSig, const std::vector<unsigned char>& vchPubKey, const CScript& scriptCode, SigVersion sigversion) const override
|
||||||
{
|
{
|
||||||
return m_fuzzed_data_provider.ConsumeBool();
|
return m_fuzzed_data_provider.ConsumeBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool CheckLockTime(const CScriptNum& nLockTime) const
|
bool CheckLockTime(const CScriptNum& nLockTime) const override
|
||||||
{
|
{
|
||||||
return m_fuzzed_data_provider.ConsumeBool();
|
return m_fuzzed_data_provider.ConsumeBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool CheckSequence(const CScriptNum& nSequence) const
|
bool CheckSequence(const CScriptNum& nSequence) const override
|
||||||
{
|
{
|
||||||
return m_fuzzed_data_provider.ConsumeBool();
|
return m_fuzzed_data_provider.ConsumeBool();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue