mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix possible nullptr dereference in serverpackethandler.cpp
This commit is contained in:
parent
b1363fce8e
commit
251bf0ec31
1 changed files with 4 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue