plugins/mod_websocket.lua
branch0.11
changeset 11114 67fb92e312f1
parent 11113 7ec7dba7ba8b
child 11115 55d8612ac357
--- a/plugins/mod_websocket.lua	Thu Sep 17 16:42:14 2020 +0100
+++ b/plugins/mod_websocket.lua	Thu Sep 17 16:42:36 2020 +0100
@@ -285,6 +285,10 @@
 		local frame, length = parse_frame(frameBuffer);
 
 		while frame do
+			if length > stanza_size_limit then
+				session:close({ condition = "policy-violation", text = "stanza too large" });
+				return;
+			end
 			frameBuffer:discard(length);
 			local result = handle_frame(frame);
 			if not result then return; end