1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-09-22 19:45:54 -04:00

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 dd566d8d56.
This commit is contained in:
Michael Vetter 2021-03-05 12:31:27 +01:00
parent f025bceda3
commit 8190301a67

View File

@ -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);
}