From 8190301a6780c5d1cab2c7dcf70546c0aaff7cd2 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Fri, 5 Mar 2021 12:31:27 +0100 Subject: Prevent segfault in sv_ev_incoming_message() Regards https://github.com/profanity-im/profanity/issues/1488 Actually I would have loved to see the stanza that caused the segfault since I'm not entirely sure whether this actually means that we do something wrong earlier on. Right now I don't know why the to_jid should be empty. Let's prevent the segfault for now and see whether we get further bugreports later. Segfaulting issue got introduced with dd566d8d561099bbfc81b2fab22318bbad0cf3da. --- src/event/server_events.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/event') diff --git a/src/event/server_events.c b/src/event/server_events.c index 7cafd4df..d297b103 100644 --- a/src/event/server_events.c +++ b/src/event/server_events.c @@ -600,7 +600,9 @@ sv_ev_incoming_message(ProfMessage* message) if (message->is_mam) { char* mybarejid = connection_get_barejid(); if (g_strcmp0(mybarejid, message->from_jid->barejid) == 0) { - looking_for_jid = message->to_jid->barejid; + if (message->to_jid) { + looking_for_jid = message->to_jid->barejid; + } } free(mybarejid); } -- cgit 1.4.1-2-gfad0 8aab'>refs log blame commit diff stats
path: root/tests/unittests/test_callbacks.c
blob: 3c5267fefb25980b34e1854115800dc95d3a2a91 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11