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(-) (limited to 'net') 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