소스 검색

Merge pull request #48333 from MaxStgs/master

Add WebSocketMultiplayerPeer _incoming_packets check bound
Rémi Verschelde 4 년 전
부모
커밋
0ad03ba052
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      modules/websocket/websocket_multiplayer_peer.cpp

+ 2 - 0
modules/websocket/websocket_multiplayer_peer.cpp

@@ -99,6 +99,8 @@ Error WebSocketMultiplayerPeer::get_packet(const uint8_t **r_buffer, int &r_buff
 		_current_packet.data = nullptr;
 	}
 
+	ERR_FAIL_COND_V(_incoming_packets.size() == 0, ERR_UNAVAILABLE);
+
 	_current_packet = _incoming_packets.front()->get();
 	_incoming_packets.pop_front();