mirror of
				https://github.com/luanti-org/luanti.git
				synced 2025-11-04 09:15:29 +01: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