Skip to content

Commit

Permalink
Merge pull request #31482 from Faless/ws/fix_relay
Browse files Browse the repository at this point in the history
WebSocketServer now sanitize destination peers.
  • Loading branch information
akien-mga authored Aug 20, 2019
2 parents 8b27f09 + 17be67b commit a1aeeb3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/websocket/websocket_multiplayer_peer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,10 @@ Error WebSocketMultiplayerPeer::_server_relay(int32_t p_from, int32_t p_to, cons

ERR_FAIL_COND_V(p_to == p_from, FAILED);

return get_peer(p_to)->put_packet(p_buffer, p_buffer_size); // Sending to specific peer
Ref<WebSocketPeer> peer_to = get_peer(p_to);
ERR_FAIL_COND_V(peer_to.is_null(), FAILED);

return peer_to->put_packet(p_buffer, p_buffer_size); // Sending to specific peer
}
}

Expand Down

0 comments on commit a1aeeb3

Please sign in to comment.