diff options
author | Michael Vetter <jubalh@iodoru.org> | 2021-03-05 12:31:27 +0100 |
---|---|---|
committer | Michael Vetter <jubalh@iodoru.org> | 2021-03-05 12:31:27 +0100 |
commit | 8190301a6780c5d1cab2c7dcf70546c0aaff7cd2 (patch) | |
tree | 17cc94df177774a32a72e95159d79678b1f0be11 /src/event | |
parent | f025bceda30b0583165e8187b91191b0f757756c (diff) | |
download | profani-tty-8190301a6780c5d1cab2c7dcf70546c0aaff7cd2.tar.gz |
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.
Diffstat (limited to 'src/event')
-rw-r--r-- | src/event/server_events.c | 4 |
1 files changed, 3 insertions, 1 deletions
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); } |