Changeset 3003 for pjproject


Ignore:
Timestamp:
Nov 10, 2009 5:09:44 AM (14 years ago)
Author:
bennylp
Message:

More ticket #940: Multiple header rows with the same name may not be completely processed by PJSIP modules:

  • handle the case when context doesn't have rdata (such as when parsing individual header or in pjsip-test), which crashed the app
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip/sip_parser.c

    r2985 r3003  
    19331933{ 
    19341934    pjsip_require_hdr *hdr; 
    1935     pj_bool_t new_hdr = (ctx->rdata->msg_info.require == NULL); 
     1935    pj_bool_t new_hdr = (ctx->rdata==NULL || 
     1936                         ctx->rdata->msg_info.require == NULL); 
    19361937     
    19371938    if (ctx->rdata && ctx->rdata->msg_info.require) { 
     
    19391940    } else { 
    19401941        hdr = pjsip_require_hdr_create(ctx->pool); 
    1941         ctx->rdata->msg_info.require = hdr; 
     1942        if (ctx->rdata) 
     1943            ctx->rdata->msg_info.require = hdr; 
    19421944    } 
    19431945 
     
    19821984{ 
    19831985    pjsip_supported_hdr *hdr; 
    1984     pj_bool_t new_hdr = (ctx->rdata->msg_info.supported == NULL); 
     1986    pj_bool_t new_hdr = (ctx->rdata==NULL ||  
     1987                         ctx->rdata->msg_info.supported == NULL); 
    19851988 
    19861989    if (ctx->rdata && ctx->rdata->msg_info.supported) { 
     
    19881991    } else { 
    19891992        hdr = pjsip_supported_hdr_create(ctx->pool); 
    1990         ctx->rdata->msg_info.supported = hdr; 
     1993        if (ctx->rdata) 
     1994            ctx->rdata->msg_info.supported = hdr; 
    19911995    } 
    19921996 
Note: See TracChangeset for help on using the changeset viewer.