1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-12 16:15:20 +02:00

Fix possible nullptr dereference in serverpackethandler.cpp

This commit is contained in:
Ricardo Costa
2025-03-26 14:31:27 -03:00
committed by GitHub
parent b1363fce8e
commit 251bf0ec31

View File

@@ -416,6 +416,8 @@ void Server::handleCommand_GotBlocks(NetworkPacket* pkt)
ClientInterface::AutoLock lock(m_clients);
RemoteClient *client = m_clients.lockedGetClientNoEx(pkt->getPeerId());
if (!client)
return;
for (u16 i = 0; i < count; i++) {
v3s16 p;
@@ -538,6 +540,8 @@ void Server::handleCommand_DeletedBlocks(NetworkPacket* pkt)
ClientInterface::AutoLock lock(m_clients);
RemoteClient *client = m_clients.lockedGetClientNoEx(pkt->getPeerId());
if (!client)
return;
for (u16 i = 0; i < count; i++) {
v3s16 p;