mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 10:38:42 +01:00
Merge bitcoin/bitcoin#24319: refactor: Avoid unsigned integer overflow in core_write
fa6065661a
refactor: Avoid unsigned integer overflow in core_write (MarcoFalke) Pull request description: Also, I find the new code a bit easier to understand. ACKs for top commit: shaavan: Code Review ACKfa6065661a
Tree-SHA512: cd751e3b4dc97ef525eb8be8d0a49e9629389cb114df18d59a06e05388822af2939078e937f01494e6b317d601743b1a433ba47aa40c4dc602372d1f0fd0dc11
This commit is contained in:
commit
fd25d3493d
@ -65,7 +65,7 @@ std::string FormatScript(const CScript& script)
|
||||
ret += strprintf("0x%x ", HexStr(std::vector<uint8_t>(it2, script.end())));
|
||||
break;
|
||||
}
|
||||
return ret.substr(0, ret.size() - 1);
|
||||
return ret.substr(0, ret.empty() ? ret.npos : ret.size() - 1);
|
||||
}
|
||||
|
||||
const std::map<unsigned char, std::string> mapSigHashTypes = {
|
||||
|
@ -47,7 +47,6 @@ unsigned-integer-overflow:arith_uint256.h
|
||||
unsigned-integer-overflow:common/bloom.cpp
|
||||
unsigned-integer-overflow:coins.cpp
|
||||
unsigned-integer-overflow:compressor.cpp
|
||||
unsigned-integer-overflow:core_write.cpp
|
||||
unsigned-integer-overflow:crypto/
|
||||
unsigned-integer-overflow:hash.cpp
|
||||
unsigned-integer-overflow:policy/fees.cpp
|
||||
|
Loading…
Reference in New Issue
Block a user