From 409bbd6f2df10d327decbfbbd86be1909e991d58 Mon Sep 17 00:00:00 2001 From: Dmitry Podgorny Date: Tue, 16 Jun 2020 17:52:01 +0300 Subject: Fix possible segfault in xmpp/message.c Check for pointer to be NULL before dereferencing it. --- src/xmpp/message.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/xmpp/message.c b/src/xmpp/message.c index b668ce84..d578786e 100644 --- a/src/xmpp/message.c +++ b/src/xmpp/message.c @@ -1169,7 +1169,7 @@ _handle_chat(xmpp_stanza_t *const stanza, gboolean is_mam) { // ignore if type not chat or absent const char *type = xmpp_stanza_get_type(stanza); - if (!(g_strcmp0(type, "chat") == 0 || type == NULL)) { + if (type == NULL || g_strcmp0(type, STANZA_TYPE_CHAT) != 0) { return; } -- cgit 1.4.1-2-gfad0