From 1fc0fb7a5e39b471f5c3d92c93fe3e9e937c28c5 Mon Sep 17 00:00:00 2001 From: MaxStgs Date: Fri, 30 Apr 2021 18:36:14 +0500 Subject: [PATCH] Add WebSocketMultiplayerPeer _incoming_packets check bound (cherry picked from commit 05ad08941b93c513dfd8667148204f10fe20cd8e) --- modules/websocket/websocket_multiplayer_peer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/websocket/websocket_multiplayer_peer.cpp b/modules/websocket/websocket_multiplayer_peer.cpp index 79c08f7b482..30bea01e33e 100644 --- a/modules/websocket/websocket_multiplayer_peer.cpp +++ b/modules/websocket/websocket_multiplayer_peer.cpp @@ -114,6 +114,8 @@ Error WebSocketMultiplayerPeer::get_packet(const uint8_t **r_buffer, int &r_buff _current_packet.data = NULL; } + ERR_FAIL_COND_V(_incoming_packets.size() == 0, ERR_UNAVAILABLE); + _current_packet = _incoming_packets.front()->get(); _incoming_packets.pop_front();