diff options
author | Kim Alvefur <zash@zash.se> | 2019-11-02 15:43:17 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-11-02 15:43:17 +0100 |
commit | 1d46ca36e68e0f686aaafec0890cdaf91279cdb4 (patch) | |
tree | b29e138c1323789a1f99439703b2b1847cfadccb | |
parent | 5123cae2ff7ce9c0abfb575615779803ae914dde (diff) | |
download | prosody-1d46ca36e68e0f686aaafec0890cdaf91279cdb4.tar.gz prosody-1d46ca36e68e0f686aaafec0890cdaf91279cdb4.zip |
mod_s2s: Only nameprep stream to/from addresses if they are present
Prevents traceback from nameprep(nil)
-rw-r--r-- | plugins/mod_s2s/mod_s2s.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua index b9c13ef2..42998c30 100644 --- a/plugins/mod_s2s/mod_s2s.lua +++ b/plugins/mod_s2s/mod_s2s.lua @@ -327,7 +327,9 @@ function stream_callbacks._streamopened(session, attr) -- Send a reply stream header -- Validate to/from - local to, from = nameprep(attr.to), nameprep(attr.from); + local to, from = attr.to, attr.from; + if to then to = nameprep(attr.to); end + if from then from = nameprep(attr.from); end if not to and attr.to then -- COMPAT: Some servers do not reliably set 'to' (especially on stream restarts) session:close({ condition = "improper-addressing", text = "Invalid 'to' address" }); return; |