Changeset 3341 for pjproject


Ignore:
Timestamp:
Oct 13, 2010 11:13:22 AM (14 years ago)
Author:
bennylp
Message:

Misc (Re #1134): do not allow subscription state callback to be called with NULL event parameter as application may not expect this

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip-simple/evsub.c

    r3331 r3341  
    558558    pjsip_evsub_state prev_state = sub->state; 
    559559    pj_str_t old_state_str = sub->state_str; 
     560    pjsip_event dummy_event; 
    560561 
    561562    sub->state = state; 
     
    575576              (int)sub->state_str.slen, 
    576577              sub->state_str.ptr)); 
     578 
     579    /* don't call the callback with NULL event, it may crash the app! */ 
     580    if (!event) { 
     581        PJSIP_EVENT_INIT_USER(dummy_event, 0, 0, 0, 0); 
     582        event = &dummy_event; 
     583    } 
    577584 
    578585    if (sub->user.on_evsub_state && sub->call_cb) 
Note: See TracChangeset for help on using the changeset viewer.