aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_s2s
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-11-02 15:43:17 +0100
committerKim Alvefur <zash@zash.se>2019-11-02 15:43:17 +0100
commit1d46ca36e68e0f686aaafec0890cdaf91279cdb4 (patch)
treeb29e138c1323789a1f99439703b2b1847cfadccb /plugins/mod_s2s
parent5123cae2ff7ce9c0abfb575615779803ae914dde (diff)
downloadprosody-1d46ca36e68e0f686aaafec0890cdaf91279cdb4.tar.gz
prosody-1d46ca36e68e0f686aaafec0890cdaf91279cdb4.zip
mod_s2s: Only nameprep stream to/from addresses if they are present
Prevents traceback from nameprep(nil)
Diffstat (limited to 'plugins/mod_s2s')
-rw-r--r--plugins/mod_s2s/mod_s2s.lua4
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;