# HG changeset patch # User Kim Alvefur # Date 1572705797 -3600 # Node ID 66fa45d244815ed56afb1a36309a20b802d2adc4 # Parent 18685a5e362eda586b41a454de4a9161f6ba1f2b mod_s2s: Only nameprep stream to/from addresses if they are present Prevents traceback from nameprep(nil) diff -r 18685a5e362e -r 66fa45d24481 plugins/mod_s2s/mod_s2s.lua --- a/plugins/mod_s2s/mod_s2s.lua Sat Nov 02 15:40:20 2019 +0100 +++ b/plugins/mod_s2s/mod_s2s.lua Sat Nov 02 15:43:17 2019 +0100 @@ -327,7 +327,9 @@ -- 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;