Changeset 5720


Ignore:
Timestamp:
Jan 8, 2018 3:20:34 AM (6 years ago)
Author:
ming
Message:

Fixed #2079: Crash in pjsip due to race condition in account's keep alive timer

Location:
pjproject/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pj/timer.c

    r5682 r5720  
    630630    { 
    631631        pj_timer_entry *node = remove_node(ht, 0); 
     632        /* Avoid re-use of this timer until the callback is done. */ 
     633        pj_timer_id_t node_timer_id = pop_freelist(ht); 
    632634        pj_grp_lock_t *grp_lock; 
    633635 
     
    648650 
    649651        lock_timer_heap(ht); 
     652        /* Now, the timer is really free for re-use. */ 
     653        push_freelist(ht, node_timer_id); 
    650654    } 
    651655    if (ht->cur_size && next_delay) { 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c

    r5718 r5720  
    20002000 
    20012001    acc = (pjsua_acc*) te->user_data; 
     2002 
     2003    /* Check if the account is still active. It might have just been deleted 
     2004     * while the keep-alive timer was about to be called (race condition). 
     2005     */ 
     2006    if (acc->ka_transport == NULL) 
     2007        goto on_return; 
    20022008 
    20032009    /* Select the transport to send the packet */ 
Note: See TracChangeset for help on using the changeset viewer.