Ignore:
Timestamp:
2009-11-19T14:58:30Z (11 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
08e5bb2
Parents:
76c85b4c
Message:

Fixed a facepalm kind of NULL pointer dereference bug.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/jabber_util.c

    r76c85b4c r20e830b  
    463463               
    464464                head = g_hash_table_lookup( jd->buddies, jid );
    465                 bud = head->next ? head->next : head;
     465                bud = ( head && head->next ) ? head->next : head;
    466466               
    467467                g_free( jid );
     
    546546{
    547547        struct jabber_data *jd = ic->proto_data;
    548         struct jabber_buddy *head, *bud, *prev, *bi;
     548        struct jabber_buddy *bud, *prev, *bi;
    549549        char *s, *full_jid;
    550550       
     
    554554                *s = 0;
    555555       
    556         if( ( head = g_hash_table_lookup( jd->buddies, full_jid ) ) )
    557         {
    558                 bud = head->next ? head->next : head;
     556        if( ( bud = g_hash_table_lookup( jd->buddies, full_jid ) ) )
     557        {
     558                if( bud->next )
     559                        bud = bud->next;
    559560               
    560561                /* If there's only one item in the list (and if the resource
Note: See TracChangeset for help on using the changeset viewer.