diff options
author | Waqas Hussain <waqas20@gmail.com> | 2009-11-24 22:42:08 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2009-11-24 22:42:08 +0500 |
commit | 4e56a3c519bc0d46a3491ca18cb58c3e8dbb5ae9 (patch) | |
tree | db205316f05d2c748144f8174844226b58ac45f7 /net | |
parent | 7b44078ada9106c282c5ba41a75728b45ac6a65e (diff) | |
download | prosody-4e56a3c519bc0d46a3491ca18cb58c3e8dbb5ae9.tar.gz prosody-4e56a3c519bc0d46a3491ca18cb58c3e8dbb5ae9.zip |
xmppclient_listener: Escape control characters when logging invalid XML.
Diffstat (limited to 'net')
-rw-r--r-- | net/xmppclient_listener.lua | 2 |
1 files changed, 1 insertions, 1 deletions
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 |