Skip to content

Commit f5f2f97

Browse files
net: Avoid UBSan warning in ProcessMessage(...)
1 parent f72d80b commit f5f2f97

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/net_processing.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2489,6 +2489,9 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
24892489
bool fRelay = true;
24902490

24912491
vRecv >> nVersion >> nServiceInt >> nTime >> addrMe;
2492+
if (nTime < 0) {
2493+
nTime = 0;
2494+
}
24922495
nServices = ServiceFlags(nServiceInt);
24932496
if (!pfrom.IsInboundConn())
24942497
{

0 commit comments

Comments
 (0)