Changeset 5949


Ignore:
Timestamp:
Mar 8, 2019 9:29:09 AM (7 months ago)
Author:
ming
Message:

Fixed #2182: Prevent crash in unpublishing presence when deleting account

Note that this fix only covers the account deletion scenario. It doesn't prevent the race condition between deleting account in publish_cb and accessing the publish session itself, which should be solved using a locking mechanism.

Thanks to Bogdan Bogdan Chifor for the report.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c

    r5805 r5949  
    13921392 
    13931393        acc->online_status = PJ_FALSE; 
     1394        acc_cfg->publish_enabled = PJ_FALSE; 
    13941395 
    13951396        if ((flags & PJSUA_DESTROY_NO_TX_MSG) == 0) { 
     
    14041405        } 
    14051406        */ 
    1406         acc_cfg->publish_enabled = PJ_FALSE; 
    14071407    } 
    14081408} 
     
    14501450 
    14511451    /* Terminate presence publication, if any */ 
    1452     pjsua_pres_unpublish(acc, flags); 
     1452    if (acc->cfg.publish_enabled) 
     1453        pjsua_pres_unpublish(acc, flags); 
    14531454} 
    14541455 
Note: See TracChangeset for help on using the changeset viewer.