A patch from Euro on trac, heavily modified by me for simplicity and to kill release-2.x.y

Sun, 04 Nov 2012 12:38:21 -0500

author
John Bailey <rekkanoryo@rekkanoryo.org>
date
Sun, 04 Nov 2012 12:38:21 -0500
branch
release-2.x.y
changeset 33471
b120a1fe399e
parent 33422
581716bd2b64
child 33472
24393ecae82e

A patch from Euro on trac, heavily modified by me for simplicity and to kill
off C99-isms. This should resolve a crash condition in the CAP plugin. Fixes
#15327.

COPYRIGHT file | annotate | diff | comparison | revisions
pidgin/plugins/cap/cap.c file | annotate | diff | comparison | revisions
--- a/COPYRIGHT	Tue Oct 09 00:58:01 2012 -0400
+++ b/COPYRIGHT	Sun Nov 04 12:38:21 2012 -0500
@@ -17,6 +17,7 @@
 
 Copyright (C) 1998-2012 by the following:
 
+Mark
 Saleem Abdulrasool
 Jakub Adam
 Dave Ahlswede
--- a/pidgin/plugins/cap/cap.c	Tue Oct 09 00:58:01 2012 -0400
+++ b/pidgin/plugins/cap/cap.c	Sun Nov 04 12:38:21 2012 -0500
@@ -43,7 +43,7 @@
 	int threshold = purple_prefs_get_int("/plugins/gtk/cap/threshold");
 	int min_minute = (current_minute - threshold) % 1440;
 	int max_minute = (current_minute + threshold) % 1440;
-	char *sql;
+	char *sql, sta_id = NULL;
 	sqlite3_stmt *stmt = NULL;
 	const char *tail = NULL;
 	int rc;
@@ -94,7 +94,9 @@
 	sqlite3_free(sql);
 
 
-	if(strcmp(purple_status_get_id(get_status_for(buddy)), "offline") == 0) {
+	sta_id = purple_status_get_id(get_status_for(buddy));
+
+	if(sta_id && !strcmp(sta_id, "offline")) {
 		/* This is kind of stupid, change it. */
 		if(prediction == 1.0f)
 			prediction = 0.0f;

mercurial