diff options
author | practicalswift <practicalswift@users.noreply.github.com> | 2021-01-31 21:03:05 +0000 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-02-11 12:42:31 +0100 |
commit | 95218ee95cdb4046ee7d622eac822e74d94314c7 (patch) | |
tree | 6b780ed1141f6433fb4dbb5c7c3b187df67d920c | |
parent | 4607019798c543f046bcd22d5b7c09750e7e0ee2 (diff) | |
download | bitcoin-95218ee95cdb4046ee7d622eac822e74d94314c7.tar.xz |
net: Avoid UBSan warning in ProcessMessage(...)
Github-Pull: #21043
Rebased-From: f5f2f9716885e7548809e77f46b493c896a019bf
-rw-r--r-- | src/net_processing.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 98e3d90c2d..f29be8d8a3 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -2305,6 +2305,9 @@ void PeerManager::ProcessMessage(CNode& pfrom, const std::string& msg_type, CDat bool fRelay = true; vRecv >> nVersion >> nServiceInt >> nTime >> addrMe; + if (nTime < 0) { + nTime = 0; + } nServices = ServiceFlags(nServiceInt); if (!pfrom.IsInboundConn()) { |