diff options
author | Stanislav Malyshev <stas@php.net> | 2016-03-20 22:39:17 -0700 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2016-03-20 22:39:17 -0700 |
commit | c4517b2a5e3141393c1c4f6fca51e1c325e91251 (patch) | |
tree | e89897b8340c52ee4f4f3f2c93e49262389a59c9 /ext | |
parent | 28a6ed9f9a36b9c517e4a8a429baf4dd382fc5d5 (diff) | |
download | php-git-c4517b2a5e3141393c1c4f6fca51e1c325e91251.tar.gz |
Fix bug #71750: use zend_string_safe_alloc for calculated allocations
Diffstat (limited to 'ext')
-rw-r--r-- | ext/standard/url.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/standard/url.c b/ext/standard/url.c index 0138e4203f..9963ce60f4 100644 --- a/ext/standard/url.c +++ b/ext/standard/url.c @@ -493,7 +493,7 @@ PHPAPI zend_string *php_url_encode(char const *s, size_t len) from = (unsigned char *)s; end = (unsigned char *)s + len; - start = zend_string_alloc(3 * len, 0); + start = zend_string_safe_alloc(3, len, 0, 0); to = (unsigned char*)ZSTR_VAL(start); while (from < end) { @@ -611,7 +611,7 @@ PHPAPI zend_string *php_raw_url_encode(char const *s, size_t len) register int x, y; zend_string *str; - str = zend_string_alloc(3 * len, 0); + str = zend_string_safe_alloc(3, len, 0, 0); for (x = 0, y = 0; len--; x++, y++) { ZSTR_VAL(str)[y] = (unsigned char) s[x]; #ifndef CHARSET_EBCDIC |