diff options
author | Stanislav Malyshev <stas@php.net> | 2016-11-03 20:36:52 -0700 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2016-11-03 20:36:52 -0700 |
commit | ea9fac94bbae150a81fde0e6542e6b45965772cd (patch) | |
tree | 124f543734d75dd5aecd9743dbe4031b4bd244a9 /ext/standard/php_smart_str.h | |
parent | 6558559bcc1cd24e3639e4a215e9d546ee05fc48 (diff) | |
download | php-git-ea9fac94bbae150a81fde0e6542e6b45965772cd.tar.gz |
More string length checks & fixes
Diffstat (limited to 'ext/standard/php_smart_str.h')
-rw-r--r-- | ext/standard/php_smart_str.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/standard/php_smart_str.h b/ext/standard/php_smart_str.h index edd9d3a89f..a336660987 100644 --- a/ext/standard/php_smart_str.h +++ b/ext/standard/php_smart_str.h @@ -57,7 +57,8 @@ newlen = (n); \ (d)->a = newlen < SMART_STR_START_SIZE \ ? SMART_STR_START_SIZE \ - : newlen + SMART_STR_PREALLOC; \ + : (newlen >= (INT_MAX - SMART_STR_PREALLOC)? newlen \ + : (newlen + INT_MAX)); \ SMART_STR_DO_REALLOC(d, what); \ } else { \ newlen = (d)->len + (n); \ |