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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user