Ignore:
Timestamp:
Apr 20, 2016 1:58:15 AM (8 years ago)
Author:
ming
Message:

Re #1882 (misc): Removed stripping of '[]' from pvalue header parameters.

The stripping of '[]' from header parameters causes issues if
something (like a port) occurrs after the final ']'.

'[2001:a::b]' will correctly parse to '2001:a::b'
'[2001:a::b]:8080' will correctly parse to '2001:a::b' but the scanner is left
with ':8080' and parsing stops with a syntax error.

Thanks to Anthony Messina and George Joseph for the patch.

File:
1 edited

Legend:

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

    r5275 r5280  
    11501150                    pvalue->slen -= 2; 
    11511151                } 
    1152             } else if (*scanner->curptr == '[') { 
     1152            // } else if (*scanner->curptr == '[') { 
    11531153                /* pvalue can be a quoted IPv6; in this case, the 
    11541154                 * '[' and ']' quote characters are to be removed 
    1155                  * from the pvalue.  
     1155                 * from the pvalue. 
     1156                 * 
     1157                 * Update: this seems to be unnecessary and may cause 
     1158                 * parsing error for cases such as IPv6 reference with 
     1159                 * port number. 
    11561160                 */ 
    1157                 pj_scan_get_char(scanner); 
    1158                 pj_scan_get_until_ch(scanner, ']', pvalue); 
    1159                 pj_scan_get_char(scanner); 
     1161                // pj_scan_get_char(scanner); 
     1162                // pj_scan_get_until_ch(scanner, ']', pvalue); 
     1163                // pj_scan_get_char(scanner); 
    11601164            } else if(pj_cis_match(spec, *scanner->curptr)) { 
    11611165                parser_get_and_unescape(scanner, pool, spec, esc_spec, pvalue); 
Note: See TracChangeset for help on using the changeset viewer.