mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Fix persistent smart_str allocation
This would allocate a too small buffer if the first smart_str allocation is > SMART_STR_START_LEN but <= SMART_STR_START_SIZE.
This commit is contained in:
@@ -45,7 +45,7 @@ ZEND_API void ZEND_FASTCALL smart_str_erealloc(smart_str *str, size_t len)
|
||||
ZEND_API void ZEND_FASTCALL smart_str_realloc(smart_str *str, size_t len)
|
||||
{
|
||||
if (UNEXPECTED(!str->s)) {
|
||||
str->a = len <= SMART_STR_START_SIZE
|
||||
str->a = len <= SMART_STR_START_LEN
|
||||
? SMART_STR_START_LEN
|
||||
: SMART_STR_NEW_LEN(len);
|
||||
str->s = zend_string_alloc(str->a, 1);
|
||||
|
||||
Reference in New Issue
Block a user