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

Michael McConville mmcconville at mykolab.com
Wed Sep 2 14:57:24 EDT 2015


Changeset: 80d13da6d42f525f7cc9622afd1b14d4353cc060
Author:	 Michael McConville <mmcconville at mykolab.com>
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));



More information about the Commits mailing list