# HG changeset patch # User Kim Alvefur # Date 1677764266 -3600 # Node ID ed20555f163a3be84e0bb50b91e694dd9976a682 # Parent e4de42495fb79411f52955eaf353fff8303a566d util.sasl.oauthbearer: Fix traceback on authz in unexpected format E.g. if you were to just pass "username" without @hostname, the split will return nil, "username" and the nil gets passed to saslprep() and it does not like that. diff -r e4de42495fb7 -r ed20555f163a util/sasl/oauthbearer.lua --- a/util/sasl/oauthbearer.lua Wed Mar 01 18:43:54 2023 +0000 +++ b/util/sasl/oauthbearer.lua Thu Mar 02 14:37:46 2023 +0100 @@ -34,6 +34,10 @@ local username = jid.prepped_split(gs2_authzid); + if not username or username == "" then + return "failure", "malformed-request", "Expected authorization identity in the username@hostname format"; + end + -- SASLprep username username = saslprep(username);