Ignore:
Timestamp:
May 9, 2014 8:57:15 AM (7 years ago)
Author:
bennylp
Message:

Re #1768: avoid crash if outgoing call fails during media initialization, because on_call_state() is called with NULL event, which is unexpected by pjsua2 (and possibly other unsuspecting apps)

File:
1 edited

Legend:

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

    r4779 r4843  
    517517        pjsua_var.ua_cfg.cb.on_call_state) 
    518518    { 
    519         (*pjsua_var.ua_cfg.cb.on_call_state)(call_id, NULL); 
     519        /* Use user event rather than NULL to avoid crash in 
     520         * unsuspecting app. 
     521         */ 
     522        pjsip_event user_event; 
     523        PJSIP_EVENT_INIT_USER(user_event, 0, 0, 0, 0); 
     524 
     525        (*pjsua_var.ua_cfg.cb.on_call_state)(call_id, &user_event); 
    520526    } 
    521527 
Note: See TracChangeset for help on using the changeset viewer.