Changeset 654
- Timestamp:
- Aug 6, 2006 2:11:52 PM (18 years ago)
- Location:
- pjproject/trunk/pjlib-util/src/pjlib-util
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib-util/src/pjlib-util/scanner.c
r583 r654 304 304 do { 305 305 if (*s == '%') { 306 if (s+3 <= scanner->end) { 307 /* This doesn't check if the hex digits are valid. 308 * If they dont' it will produce garbage characters, but 309 * no harm is done to the application (e.g. no illegal 310 * memory access. 311 */ 306 if (s+3 <= scanner->end && pj_isxdigit(*(s+1)) && 307 pj_isxdigit(*(s+2))) 308 { 312 309 *dst = (pj_uint8_t) ((pj_hex_digit_to_val(*(s+1)) << 4) + 313 310 pj_hex_digit_to_val(*(s+2))); -
pjproject/trunk/pjlib-util/src/pjlib-util/string.c
r67 r654 35 35 36 36 while (src != end) { 37 if (*src == '%' && src < end-2) { 37 if (*src == '%' && src < end-2 && pj_isxdigit(*(src+1)) && 38 pj_isxdigit(*(src+2))) 39 { 38 40 *dst = (pj_uint8_t) ((pj_hex_digit_to_val(*(src+1)) << 4) + 39 41 pj_hex_digit_to_val(*(src+2)));
Note: See TracChangeset
for help on using the changeset viewer.