Changeset

10381:66fa45d24481

mod_s2s: Only nameprep stream to/from addresses if they are present Prevents traceback from nameprep(nil)
author Kim Alvefur <zash@zash.se>
date Sat, 02 Nov 2019 15:43:17 +0100
parents 10380:18685a5e362e
children 10382:fcdc65bc6697
files plugins/mod_s2s/mod_s2s.lua
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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;