pidgin/pidgin

Fix a crash when requesting your own info in an XMPP conference
release-2.x.y
24 months ago, Belgin Știrbu
851d7f3cce88
Parents ea52fcc50e50
Children ccd35a6add9c
Fix a crash when requesting your own info in an XMPP conference

Testing Done:
Right clicked on my own user in an XMPP MUC, and clicked "Info". Before this patch, it reliably crashed; after the patch, it doesn't crash anymore.

Reviewed at https://reviews.imfreedom.org/r/1465/
--- a/libpurple/protocols/jabber/buddy.c Thu May 19 23:49:58 2022 -0500
+++ b/libpurple/protocols/jabber/buddy.c Fri May 20 15:14:37 2022 -0500
@@ -1044,7 +1044,7 @@
} else if(text && purple_strequal(child->name, "NICKNAME")) {
/* Prefer the Nickcname to the Full Name as the serverside alias if it's not just part of the jid.
* Ignore it if it's part of the jid. */
- if (strstr(bare_jid, text) == NULL) {
+ if (bare_jid != NULL && strstr(bare_jid, text) == NULL) {
g_free(serverside_alias);
serverside_alias = g_strdup(text);