Ignore:
Timestamp:
Nov 14, 2017 8:20:15 AM (7 years ago)
Author:
ming
Message:

Fixed #2063: Add more documentation in PJSIP's parser to prevent stack buffer overflow

File:
1 edited

Legend:

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

    r4641 r5693  
    2323#include <pj/except.h> 
    2424#include <pj/os.h> 
     25#include <pj/log.h> 
    2526#include <pj/errno.h> 
    2627#include <pj/assert.h> 
     28 
     29#define THIS_FILE   "scanner.c" 
    2730 
    2831#define PJ_SCAN_IS_SPACE(c)             ((c)==' ' || (c)=='\t') 
     
    117120{ 
    118121    PJ_CHECK_STACK(); 
     122 
     123    /* Buffer validation. Must be NULL terminated. 
     124     * See ticket #2063. 
     125     */ 
     126    pj_assert(*scanner->end == 0); 
    119127 
    120128    scanner->begin = scanner->curptr = bufstart; 
Note: See TracChangeset for help on using the changeset viewer.