浏览代码

Add WebSocketMultiplayerPeer _incoming_packets check bound

MaxStgs 4 年之前
父节点
当前提交
05ad08941b
共有 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;
 		_current_packet.data = nullptr;
 	}
 	}
 
 
+	ERR_FAIL_COND_V(_incoming_packets.size() == 0, ERR_UNAVAILABLE);
+
 	_current_packet = _incoming_packets.front()->get();
 	_current_packet = _incoming_packets.front()->get();
 	_incoming_packets.pop_front();
 	_incoming_packets.pop_front();