Ignore:
Timestamp:
Apr 7, 2008 10:10:31 AM (17 years ago)
Author:
bennylp
Message:

Fixed crash in SRTP when incoming SDP is received without any m= line (thanks Atik)

File:
1 edited

Legend:

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

    r1873 r1909  
    717717                                   rdata->msg_info.msg->body->len, &offer); 
    718718        if (status != PJ_SUCCESS) { 
    719             pjsua_perror(THIS_FILE, "Error parsing SDP in incoming INVITE", status); 
    720             pjsip_endpt_respond_stateless(pjsua_var.endpt, rdata, 400, NULL, 
     719            const pj_str_t reason = pj_str("Bad SDP"); 
     720            pjsua_perror(THIS_FILE, "Error parsing SDP in incoming INVITE",  
     721                         status); 
     722            pjsip_endpt_respond_stateless(pjsua_var.endpt, rdata, 400, &reason, 
    721723                                          NULL, NULL); 
    722724            pjsua_media_channel_deinit(call->index); 
     
    724726            return PJ_TRUE; 
    725727        } 
     728 
     729        /* Do quick checks on SDP before passing it to transports. More elabore  
     730         * checks will be done in pjsip_inv_verify_request2() below. 
     731         */ 
     732        if (offer->media_count==0) { 
     733            const pj_str_t reason = pj_str("Missing media in SDP"); 
     734            pjsip_endpt_respond(pjsua_var.endpt, NULL, rdata, 400, &reason,  
     735                                NULL, NULL, NULL); 
     736            PJSUA_UNLOCK(); 
     737            return PJ_TRUE; 
     738        } 
     739 
    726740    } else { 
    727741        offer = NULL; 
Note: See TracChangeset for help on using the changeset viewer.