Software /
code /
prosody
Diff
plugins/mod_dialback.lua @ 10376:b337df192a10
mod_dialback: Abort early if request is missing addressing attributes
Prevents traceback from passing nil to nameprep()
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 02 Nov 2019 15:27:53 +0100 |
parent | 8518:0de0018bdf91 |
child | 10380:18685a5e362e |
line wrap: on
line diff
--- 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