mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-19 01:42:58 +01:00
Avoid triggering undefined behaviour (std::memset(nullptr, 0, 0)) if an invalid string is passed to DecodeSecret(...)
This commit is contained in:
parent
1933e38c1a
commit
d855e4cac8
@ -142,7 +142,9 @@ CKey DecodeSecret(const std::string& str)
|
||||
key.Set(data.begin() + privkey_prefix.size(), data.begin() + privkey_prefix.size() + 32, compressed);
|
||||
}
|
||||
}
|
||||
memory_cleanse(data.data(), data.size());
|
||||
if (!data.empty()) {
|
||||
memory_cleanse(data.data(), data.size());
|
||||
}
|
||||
return key;
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,6 @@ bool:wallet/wallet.cpp
|
||||
float-divide-by-zero:policy/fees.cpp
|
||||
float-divide-by-zero:validation.cpp
|
||||
float-divide-by-zero:wallet/wallet.cpp
|
||||
nonnull-attribute:support/cleanse.cpp
|
||||
unsigned-integer-overflow:arith_uint256.h
|
||||
unsigned-integer-overflow:basic_string.h
|
||||
unsigned-integer-overflow:bench/bench.h
|
||||
|
Loading…
Reference in New Issue
Block a user