From 95218ee95cdb4046ee7d622eac822e74d94314c7 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Sun, 31 Jan 2021 21:03:05 +0000 Subject: [PATCH] net: Avoid UBSan warning in ProcessMessage(...) Github-Pull: #21043 Rebased-From: f5f2f9716885e7548809e77f46b493c896a019bf --- src/net_processing.cpp | 3 +++ 1 file changed, 3 insertions(+) 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()) {