[Pidgin] #2752: libpurple lets you add buddies to blist inside groups that aren't on blist; leads to duplicate groups

Pidgin trac at pidgin.im
Fri Aug 24 01:02:51 EDT 2007


#2752: libpurple lets you add buddies to blist inside groups that aren't on blist;
leads to duplicate groups
------------------------+---------------------------------------------------
  Reporter:  jeff       |       Owner:  jeff    
      Type:  defect     |      Status:  assigned
  Priority:  trivial    |   Milestone:          
 Component:  libpurple  |     Version:  2.1.1   
Resolution:             |    Keywords:  msimprpl
   Pending:  0          |  
------------------------+---------------------------------------------------
Comment (by jeff):

 Patch below causes this assertion if someone tries to add a buddy to a
 group that isn't on the buddy list:
 {{{
 (21:58:36) g_log: purple_blist_add_buddy: assertion
 `purple_find_group(group->name)' failed
 }}}

 Patch:
 {{{
 #
 # old_revision [ee8ee01aef3f53a96479de7c1becc6acb4a24fed]
 #
 # patch "libpurple/blist.c"
 #  from [8baced85c0fded9721bee0d5b841a56da23e2f74]
 #    to [7cf4137e09955a376777574602b30c1378c6d055]
 #
 ============================================================
 --- libpurple/blist.c   8baced85c0fded9721bee0d5b841a56da23e2f74
 +++ libpurple/blist.c   7cf4137e09955a376777574602b30c1378c6d055
 @@ -1190,6 +1190,9 @@ void purple_blist_add_chat(PurpleChat *c
                         group = purple_group_new(_("Chats"));
                         purple_blist_add_group(group,
 purple_blist_get_last_sibling(purplebuddylist->root));
 +               } else {
 +                       /* Fail if tried to add buddy to a group that
 isn't on the blist. #2752. */
 +                       g_return_if_fail(purple_find_group(group->name));
                 }
         } else {
                 group = (PurpleGroup*)node->parent;
 @@ -1284,6 +1287,10 @@ void purple_blist_add_buddy(PurpleBuddy
                 g = (PurpleGroup *)((PurpleBlistNode *)c)->parent;
         } else {
                 if (group) {
 +                       /*  Fail if trying to add buddy to a group that is
 not on the buddy list.
 +                        *  Fixes #2752. */
 +                       g_return_if_fail(purple_find_group(group->name));
 +
                         g = group;
                 } else {
                         g = purple_group_new(_("Buddies"));
 }}}

-- 
Ticket URL: <http://developer.pidgin.im/ticket/2752#comment:4>
Pidgin <http://pidgin.im>
Pidgin


More information about the Tracker mailing list