From 4e56a3c519bc0d46a3491ca18cb58c3e8dbb5ae9 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Tue, 24 Nov 2009 22:42:08 +0500 Subject: xmppclient_listener: Escape control characters when logging invalid XML. --- net/xmppclient_listener.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/xmppclient_listener.lua b/net/xmppclient_listener.lua index 417dfd4a..01d73a36 100644 --- a/net/xmppclient_listener.lua +++ b/net/xmppclient_listener.lua @@ -61,7 +61,7 @@ local function session_reset_stream(session) function session.data(conn, data) local ok, err = parser:parse(data); if ok then return; end - log("debug", "Received invalid XML (%s) %d bytes: %s", tostring(err), #data, data:sub(1, 300):gsub("[\r\n]+", " ")); + log("debug", "Received invalid XML (%s) %d bytes: %s", tostring(err), #data, data:sub(1, 300):gsub("[\r\n]+", " "):gsub("[%z\1-\31]", "_")); session:close("xml-not-well-formed"); end -- cgit v1.2.3 From 38e55888e5c0a041f876281cfeb6230be406c7c3 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Wed, 25 Nov 2009 15:40:33 +0000 Subject: util.dependencies: Log an error if the current version of LuaSec installed contains The Bug (thanks Remko) --- util/dependencies.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/util/dependencies.lua b/util/dependencies.lua index 6decfba5..790045eb 100644 --- a/util/dependencies.lua +++ b/util/dependencies.lua @@ -71,6 +71,11 @@ if not ssl then ["Source"] = "http://www.inf.puc-rio.br/~brunoos/luasec/"; }, "SSL/TLS support will not be available"); end +else + local major, minor, veryminor, patched = ssl._VERSION:match("(%d+)%.(%d+)%.?(%d*)(M?)"); + if not major or ((tonumber(major) == 0 and (tonumber(minor) or 0) <= 3 and (tonumber(veryminor) or 0) <= 2) and patched ~= "M") then + log("error", "This version of LuaSec contains a known bug that causes disconnects, see http://prosody.im/doc/depends"); + end end local encodings, err = softreq "util.encodings" -- cgit v1.2.3