Ignore:
Timestamp:
Nov 14, 2017 8:20:15 AM (6 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/include/pjlib-util/scanner.h

    r4537 r5693  
    217217 
    218218/** 
    219  * Initialize the scanner. Note that the input string buffer must have 
    220  * length at least buflen+1 because the scanner will NULL terminate the 
    221  * string during initialization. 
     219 * Initialize the scanner. 
     220 * Note that the input string buffer MUST be NULL terminated and have 
     221 * length at least buflen+1 (buflen MUST NOT include the NULL terminator). 
    222222 * 
    223223 * @param scanner   The scanner to be initialized. 
    224  * @param bufstart  The input buffer to scan. Note that buffer[buflen] will be  
    225  *                  filled with NULL char until scanner is destroyed, so 
    226  *                  the actual buffer length must be at least buflen+1. 
     224 * @param bufstart  The input buffer to scan, which must be NULL terminated. 
    227225 * @param buflen    The length of the input buffer, which normally is 
    228  *                  strlen(bufstart). 
     226 *                  strlen(bufstart), hence not counting the NULL terminator. 
    229227 * @param options   Zero, or combination of PJ_SCAN_AUTOSKIP_WS or 
    230228 *                  PJ_SCAN_AUTOSKIP_WS_HEADER 
Note: See TracChangeset for help on using the changeset viewer.