Ignore:
Timestamp:
Jul 2, 2006 9:29:09 AM (18 years ago)
Author:
bennylp
Message:

Fixed bugs in scanner: (1) pj_cis_match() takes int argument, so when ASCII character above 127 is given, it will access the array with negative index, and (2) pj_scan_get_newline() may incorrectly eat two newlines when the second newline is a header continuation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib-util/src/pjlib-util/scanner.c

    r185 r570  
    402402    scanner->start_line = scanner->curptr; 
    403403 
    404     if (PJ_SCAN_IS_PROBABLY_SPACE(*scanner->curptr) && scanner->skip_ws) { 
    405         pj_scan_skip_whitespace(scanner); 
    406     } 
     404    /** 
     405     * This probably is a bug, see PROTOS test #2480. 
     406     * This would cause scanner to incorrectly eat two new lines, e.g. 
     407     * when parsing: 
     408     *    
     409     *  Content-Length: 120\r\n 
     410     *  \r\n 
     411     *  <space><space><space>... 
     412     * 
     413     * When pj_scan_get_newline() is called to parse the first newline 
     414     * in the Content-Length header, it will eat the second newline 
     415     * too because it thinks that it's a header continuation. 
     416     * 
     417     * if (PJ_SCAN_IS_PROBABLY_SPACE(*scanner->curptr) && scanner->skip_ws) { 
     418     *    pj_scan_skip_whitespace(scanner); 
     419     * } 
     420     */ 
    407421} 
    408422 
Note: See TracChangeset for help on using the changeset viewer.