From b0cd636924d7e086fe9d688073cf2a22188cc604 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Sat, 20 May 2017 11:04:20 +0300 Subject: [PATCH] [General] Add basic integrity check to ProxyMasterPacket --- components/openmw-mp/Master/ProxyMasterPacket.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/components/openmw-mp/Master/ProxyMasterPacket.hpp b/components/openmw-mp/Master/ProxyMasterPacket.hpp index cc6755bb7..d5d4506b5 100644 --- a/components/openmw-mp/Master/ProxyMasterPacket.hpp +++ b/components/openmw-mp/Master/ProxyMasterPacket.hpp @@ -29,6 +29,9 @@ namespace mwmp packet->RW(rulesSize, send); + if (rulesSize > 2000) + rulesSize = 0; + map::iterator ruleIt; if (send) ruleIt = server.rules.begin(); @@ -71,6 +74,9 @@ namespace mwmp int playersCount = server.players.size(); packet->RW(playersCount, send); + if (playersCount > 2000) + playersCount = 0; + while (playersCount--) { string player; @@ -88,6 +94,9 @@ namespace mwmp int pluginsCount = server.plugins.size(); packet->RW(pluginsCount, send); + if (pluginsCount > 2000) + pluginsCount = 0; + vector::iterator pluginIt; if (send)