summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-04-30 20:12:35 +0200
committerGitHub <noreply@github.com>2021-04-30 20:12:35 +0200
commit0ad03ba052dd3b7bea558a3a76c7ff5c46bf681a (patch)
treea9bd224ae85e0388308ad7ae407d38fd504dd017
parent87e8e71190470b0cbea528376f18743c346aceed (diff)
parent05ad08941b93c513dfd8667148204f10fe20cd8e (diff)
Merge pull request #48333 from MaxStgs/master
Add WebSocketMultiplayerPeer _incoming_packets check bound
-rw-r--r--modules/websocket/websocket_multiplayer_peer.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/websocket/websocket_multiplayer_peer.cpp b/modules/websocket/websocket_multiplayer_peer.cpp
index 369d53bca4..fa0ef7060f 100644
--- a/modules/websocket/websocket_multiplayer_peer.cpp
+++ b/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();