diff mcabber/mcabber/xmpp_s10n.c @ 2210:ea90906cb691

Add a few more checks
author Mikael Berthe <mikael@lilotux.net>
date Fri, 23 Oct 2015 20:47:26 +0200
parents e6d355e50d7a
children f5402d705f67
line wrap: on
line diff
--- a/mcabber/mcabber/xmpp_s10n.c	Fri Oct 23 19:55:08 2015 +0200
+++ b/mcabber/mcabber/xmpp_s10n.c	Fri Oct 23 20:47:26 2015 +0200
@@ -30,6 +30,10 @@
 // Send a s10n message with the passed subtype
 void xmpp_send_s10n(const char *bjid, LmMessageSubType type)
 {
+  if (G_UNLIKELY(!bjid || !*bjid)) {
+    scr_LogPrint(LPRINT_LOGNORM, "Empty JID.");
+    return;
+  }
   LmMessage *x = lm_message_new_with_sub_type(bjid,
                                               LM_MESSAGE_TYPE_PRESENCE,
                                               type);