Ignore:
Timestamp:
Jul 2, 2006 2:53:05 PM (18 years ago)
Author:
bennylp
Message:

Final changeset from the PROTOS testing, fixed misc. crashes. See
mailing list archive for the details

File:
1 edited

Legend:

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

    r515 r576  
    479479    rec.hname_len = strlen(name); 
    480480    if (rec.hname_len >= sizeof(rec.hname)) { 
     481        pj_assert(!"Header name is too long!"); 
    481482        return PJ_ENAMETOOLONG; 
    482483    } 
     
    546547 
    547548    if (hname->slen >= PJSIP_MAX_HNAME_LEN) { 
    548         pj_assert(!"Header name is too long!"); 
     549        /* Guaranteed not to be able to find handler. */ 
    549550        return NULL; 
    550551    } 
     
    832833            pjsip_parse_hdr_func * handler; 
    833834            pjsip_hdr *hdr = NULL; 
     835 
     836            /* Init hname just in case parsing fails. 
     837             * Ref: PROTOS #2412 
     838             */ 
     839            hname.slen = 0; 
    834840             
    835841            /* Get hname. */ 
     
    914920            if (parsing_headers) 
    915921                err_info->hname = hname; 
     922            else if (msg && msg->type == PJSIP_REQUEST_MSG) 
     923                err_info->hname = pj_str("Request Line"); 
     924            else if (msg && msg->type == PJSIP_RESPONSE_MSG) 
     925                err_info->hname = pj_str("Status Line"); 
    916926            else 
    917927                err_info->hname.slen = 0; 
     
    11261136                                pj_bool_t parse_params) 
    11271137{ 
     1138    /* Bug: 
     1139     * This function should not call back int_parse_name_addr() because 
     1140     * it is called by that function. This would cause stack overflow 
     1141     * with PROTOS test #1223. 
    11281142    if (*scanner->curptr=='"' || *scanner->curptr=='<') { 
    11291143        return (pjsip_uri*)int_parse_name_addr( scanner, pool ); 
    11301144    } else { 
     1145    */ 
    11311146        pj_str_t scheme; 
    11321147        int colon; 
     
    11481163            UNREACHED({ return NULL; /* Not reached. */ }) 
    11491164        } 
    1150     } 
     1165 
     1166    /* 
     1167    } 
     1168    */ 
    11511169} 
    11521170 
Note: See TracChangeset for help on using the changeset viewer.