mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
Merge #21043: net: Avoid UBSan warning in ProcessMessage(...)
3ddbf22ed1util: Disallow negative mocktime (MarcoFalke)f5f2f97168net: Avoid UBSan warning in ProcessMessage(...) (practicalswift) Pull request description: Avoid UBSan warning in `ProcessMessage(...)`. Context: https://github.com/bitcoin/bitcoin/pull/20380#issuecomment-770427182 (thanks Crypt-iQ!) ACKs for top commit: MarcoFalke: re-ACK3ddbf22ed1only change is adding patch written by me ajtowns: ACK3ddbf22ed1-- code review only Tree-SHA512: e8d7af0457ca86872b75a4e406c0a93aafd841c2962e244e147e748cc7ca118c56be0fdafe53765f4b291410030b2c3cc8f76f733b37a955d34fc885ab6037b9
This commit is contained in:
@@ -2489,6 +2489,9 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
|
||||
bool fRelay = true;
|
||||
|
||||
vRecv >> nVersion >> nServiceInt >> nTime >> addrMe;
|
||||
if (nTime < 0) {
|
||||
nTime = 0;
|
||||
}
|
||||
nServices = ServiceFlags(nServiceInt);
|
||||
if (!pfrom.IsInboundConn())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user