# HG changeset patch # User Waqas Hussain # Date 1238372770 -18000 # Node ID 663f75dd7b42417462282ff4fce8eb5c50a790ba # Parent 40ccaacb20006b779398eab9d470e9b6a33a9daa Fixed: Some nil access bugs diff -r 40ccaacb2000 -r 663f75dd7b42 core/s2smanager.lua --- a/core/s2smanager.lua Mon Mar 30 04:39:12 2009 +0500 +++ b/core/s2smanager.lua Mon Mar 30 05:26:10 2009 +0500 @@ -212,8 +212,8 @@ if session.direction == "incoming" then -- Send a reply stream header - session.to_host = nameprep(attr.to); - session.from_host = nameprep(attr.from); + session.to_host = attr.to and nameprep(attr.to); + session.from_host = attr.from and nameprep(attr.from); session.streamid = uuid_gen(); (session.log or log)("debug", "incoming s2s received "); diff -r 40ccaacb2000 -r 663f75dd7b42 plugins/mod_saslauth.lua --- a/plugins/mod_saslauth.lua Mon Mar 30 04:39:12 2009 +0500 +++ b/plugins/mod_saslauth.lua Mon Mar 30 05:26:10 2009 +0500 @@ -74,7 +74,7 @@ -- FIXME ignoring duplicates because ejabberd does if config.get(session.host or "*", "core", "anonymous_login") and stanza.attr.mechanism ~= "ANONYMOUS" then return session.send(build_reply("failure", "invalid-mechanism")); - elseif mechanism == "ANONYMOUS" then + elseif stanza.attr.mechanism == "ANONYMOUS" then return session.send(build_reply("failure", "mechanism-too-weak")); end session.sasl_handler = new_sasl(stanza.attr.mechanism, session.host, password_callback);