From 3562d4220c7b2579990356085b0bec24c34392b2 Mon Sep 17 00:00:00 2001 From: Wim Date: Sat, 7 Sep 2019 21:36:25 +0200 Subject: Bail if incorrect Jid (xmpp). Fixes #869 (#883) --- bridge/xmpp/xmpp.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'bridge/xmpp/xmpp.go') diff --git a/bridge/xmpp/xmpp.go b/bridge/xmpp/xmpp.go index e950bcda..8f993a83 100644 --- a/bridge/xmpp/xmpp.go +++ b/bridge/xmpp/xmpp.go @@ -107,6 +107,9 @@ func (b *Bxmpp) Send(msg config.Message) (string, error) { } func (b *Bxmpp) createXMPP() error { + if !strings.Contains(b.GetString("Jid"), "@") { + return fmt.Errorf("the Jid %s doesn't contain an @", b.GetString("Jid")) + } tc := &tls.Config{ ServerName: strings.Split(b.GetString("Jid"), "@")[1], InsecureSkipVerify: b.GetBool("SkipTLSVerify"), // nolint: gosec -- cgit v1.2.3