From 2365831f7dfc9f7b3d3ce66ce38c19ad0f2a93e4 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Mon, 30 Mar 2009 05:26:10 +0500 Subject: Fixed: Some nil access bugs --- core/s2smanager.lua | 4 ++-- plugins/mod_saslauth.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/s2smanager.lua b/core/s2smanager.lua index 4e12eb8a..f4f7ad36 100644 --- a/core/s2smanager.lua +++ b/core/s2smanager.lua @@ -212,8 +212,8 @@ function streamopened(session, attr) 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 --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua index 3018b825..31d62325 100644 --- a/plugins/mod_saslauth.lua +++ b/plugins/mod_saslauth.lua @@ -74,7 +74,7 @@ local function sasl_handler(session, stanza) -- 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); -- cgit v1.2.3