mirror of
https://github.com/php/php-src.git
synced 2024-09-24 03:17:26 +00:00
Check for string overflow
This commit is contained in:
parent
4f6a97f532
commit
7bf6d98535
@ -61,6 +61,9 @@
|
||||
: newlen + SMART_STRING_PREALLOC; \
|
||||
SMART_STRING_DO_REALLOC(d, what); \
|
||||
} else { \
|
||||
if(UNEXPECTED(n > SIZE_MAX - (d)->len)) { \
|
||||
zend_error(E_ERROR, "String size overflow"); \
|
||||
} \
|
||||
newlen = (d)->len + (n); \
|
||||
if (newlen >= (d)->a) { \
|
||||
(d)->a = newlen + SMART_STRING_PREALLOC; \
|
||||
|
Loading…
Reference in New Issue
Block a user