Opened 7 years ago

Closed 7 years ago

#15327 closed patch (fixed)

CAP plugin crash FIX

Reported by: Euro Owned by: rekkanoryo
Milestone: 2.10.7 Component: plugins
Version: 2.10.6 Keywords: crash cap plugin segfault skype tooltip

Description (last modified by Euro)

I have found a way to reproduce the a crash:

  1. enabled the cap plugin
  2. connect to skype account via the pidgin-skype plugin
  3. have a not-authorized contact in your list "(To pending)"
  4. hover this user in pidgin

So it has to do with tooltip callback in the plugin:

static void drawing_tooltip(PurpleBlistNode *node, GString *text, gboolean full);

The last log messages shown were:

(17:05:36) g_log: purple_status_get_name: assertion `status != NULL' failed
(17:05:36) g_log: purple_status_get_id: assertion `status != NULL' failed
(17:05:36) g_log: purple_status_get_id: assertion `status != NULL' failed

(in this cases these functions return NULL)

So i searched the plugin code for calls to purple_status_get_id and found this line:

cap.c line 97

if(strcmp(purple_status_get_id(get_status_for(buddy)), "offline") == 0) {

So if get_status_for(buddy) returns NULL (because of a non-authorized Buddy [ano: it should return invisible, but the skype plugin seems to have a bug here]) it leads to:

strcmp(NULL, "offl...

, what causes the SEGFAULT.

Fix for line 97:

char *status = purple_status_get_id(get_status_for(buddy));
// btw. gchar *status_id is already defined above in the function, i dont know why it is not used here
if(status != NULL && strcmp(status, "offline") == 0) {

PS: Sorry for my english-skills :D

Attachments (1)

nullcheck.patch (685 bytes) - added by Euro 7 years ago.

Download all attachments as: .zip

Change History (8)

Changed 7 years ago by Euro

comment:1 Changed 7 years ago by Euro

  • Component changed from unclassified to plugins
  • Type changed from defect to patch

comment:2 Changed 7 years ago by Euro

  • Description modified (diff)

comment:3 Changed 7 years ago by rekkanoryo

This patch looks good to me; it just needs some minor tweaking to kill off C99isms (we prefer to keep as much of our codebase as possible in ANSI C). I'll take care of that when I commit. Before I commit, I need a name and e-mail address to credit you for the patch.

comment:4 Changed 7 years ago by rekkanoryo

I should note that if you wish, I can take those details from your trac account.

comment:5 Changed 7 years ago by Euro

You can take the details from the trac account if credits are necessary.

comment:6 Changed 7 years ago by John Bailey <rekkanoryo@…>

(In [d21146f8dd2e]):
ChangeLog my last two items. Refs #15327.

comment:7 Changed 7 years ago by rekkanoryo

  • Milestone set to 2.10.7
  • Resolution set to fixed
  • Status changed from new to closed

I committed a modified version of this patch that will still have the intended effect in b120a1fe399e.

Note: See TracTickets for help on using tickets.
All information, including names and email addresses, entered onto this website or sent to mailing lists affiliated with this website will be public. Do not post confidential information, especially passwords!