mod_dialback: Abort early if request is missing addressing attributes
Prevents traceback from passing nil to nameprep()
--- a/plugins/mod_dialback.lua Sat Nov 02 13:56:13 2019 +0100
+++ b/plugins/mod_dialback.lua Sat Nov 02 15:27:53 2019 +0100
@@ -93,6 +93,11 @@
-- he wants to be identified through dialback
-- We need to check the key with the Authoritative server
local attr = stanza.attr;
+ if not attr.to or not attr.from then
+ origin.log("debug", "Missing Dialback addressing (from=%q, to=%q)", attr.from, attr.to);
+ origin:close("improper-addressing");
+ return true;
+ end
local to, from = nameprep(attr.to), nameprep(attr.from);
if not hosts[to] then