Ignore:
Timestamp:
Mar 12, 2009 11:25:11 AM (12 years ago)
Author:
bennylp
Message:

Initial fixes for ticket #747: bugs in parsing SIP torture messages (RFC 4475):

  • SIP version components may be separated by whitespaces (e.g. "SIP / 2.0")
  • parsing of mangled header when for unknown/generic header
  • Via parameters were parsed with paramchar rather than token
  • handling NULL character inside quoted string

Some torture messages have been added in the Python test.

File:
1 edited

Legend:

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

    r2394 r2505  
    2929#define PJ_SCAN_IS_NEWLINE(c)           ((c)=='\r' || (c)=='\n') 
    3030#define PJ_SCAN_IS_PROBABLY_SPACE(c)    ((c) <= 32) 
    31 #define PJ_SCAN_CHECK_EOF(s)            (*s) 
     31#define PJ_SCAN_CHECK_EOF(s)            (s != scanner->end) 
    3232 
    3333 
     
    376376    do { 
    377377        /* loop until end_quote is found. */ 
    378         while (*s && *s != '\n' && *s != end_quote[qpair]) { 
     378        while (PJ_SCAN_CHECK_EOF(s) && *s != '\n' && *s != end_quote[qpair]) { 
    379379            ++s; 
    380380        } 
Note: See TracChangeset for help on using the changeset viewer.