Ignore:
Timestamp:
Dec 30, 2015 4:07:28 AM (9 years ago)
Author:
ming
Message:

Re #1882 (misc): Moved checking of header count earlier when parsing generic array header in sip_parser.

Thanks to Dusan Klinec for the patch.

File:
1 edited

Legend:

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

    r5202 r5223  
    16721672    hdr->count++; 
    16731673 
    1674     while (*scanner->curptr == ',') { 
     1674    while ((hdr->count < PJSIP_GENERIC_ARRAY_MAX_COUNT) && 
     1675           (*scanner->curptr == ',')) 
     1676    { 
    16751677        pj_scan_get_char(scanner); 
    16761678        pj_scan_get( scanner, &pconst.pjsip_NOT_COMMA_OR_NEWLINE,  
    16771679                     &hdr->values[hdr->count]); 
    16781680        hdr->count++; 
    1679  
    1680         if (hdr->count >= PJSIP_GENERIC_ARRAY_MAX_COUNT) 
    1681             break; 
    16821681    } 
    16831682 
Note: See TracChangeset for help on using the changeset viewer.