From 0664ac358ab979b91c8ab7a5973b89fd7b16b129 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Wed, 21 Oct 2009 14:05:33 +0100 Subject: xmlhandlers: Reset state on error or stream close, fixes possible traceback --- core/xmlhandlers.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core/xmlhandlers.lua') diff --git a/core/xmlhandlers.lua b/core/xmlhandlers.lua index 7f47cf70..9ded74c3 100644 --- a/core/xmlhandlers.lua +++ b/core/xmlhandlers.lua @@ -114,12 +114,13 @@ function init_xmlhandlers(session, stream_callbacks) if cb_streamclosed then cb_streamclosed(session); end - return; elseif name == "error" then cb_error(session, "stream-error", stanza); else cb_error(session, "parse-error", "unexpected-element-close", name); end + stanza, chardata = nil, {}; + return; end if #chardata > 0 then -- We have some character data in the buffer -- cgit v1.2.3