From f5f2f9716885e7548809e77f46b493c896a019bf 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(...) --- src/net_processing.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/net_processing.cpp b/src/net_processing.cpp index b68453759a0..8936b8109d2 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -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()) {