/pidgin/main: 80d13da6d42f: Prevent a null pointer dereference. ...

Michael McConville <[email protected]>
Newsgroups gmane.comp.gnome.gaim.cvs
Message-ID <[email protected]>
Changeset: 80d13da6d42f525f7cc9622afd1b14d4353cc060
Author:	 Michael McConville <[email protected]>
Date:	 2015-09-02 14:56 -0400
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/80d13da6d42f

Description:

Prevent a null pointer dereference. Found with the Clang static analyzer.

diffstat:

 libpurple/protocols/jabber/presence.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff --git a/libpurple/protocols/jabber/presence.c b/libpurple/protocols/jabber/presence.c
--- a/libpurple/protocols/jabber/presence.c
+++ b/libpurple/protocols/jabber/presence.c
@@ -334,7 +334,7 @@ PurpleXmlNode *jabber_presence_create_js
 	}
 
 	/* if we are idle and not offline, include idle */
-	if (js->idle && state != JABBER_BUDDY_STATE_UNAVAILABLE) {
+	if (js && js->idle && state != JABBER_BUDDY_STATE_UNAVAILABLE) {
 		PurpleXmlNode *query = purple_xmlnode_new_child(presence, "query");
 		gchar seconds[10];
 		g_snprintf(seconds, 10, "%d", (int) (time(NULL) - js->idle));

_______________________________________________
Commits mailing list
[email protected]
https://pidgin.im/cgi-bin/mailman/listinfo/commits
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.