diff options
author | Anatol Belski <ab@php.net> | 2016-10-12 16:06:11 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2016-10-12 16:06:11 +0200 |
commit | d103a41679db22fa8ad6787792d7c49c18db2ad2 (patch) | |
tree | 2f2d9a357c28d79a70972396a97a152f71aa59c5 /ext/standard/math.c | |
parent | d19898b2981c839f0758571c1b83052111634154 (diff) | |
parent | b135ba3fa93fd4f085322573d2850b29cb662e21 (diff) | |
download | php-git-d103a41679db22fa8ad6787792d7c49c18db2ad2.tar.gz |
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
followup with #73276 merge
fix test
Fix bug #73276 - crash in openssl_random_pseudo_bytes function
Fix bug #73293 - NULL pointer dereference in SimpleXMLElement::asXML()
Fix for #73240 - Write out of bounds at number_format
avoid strlen
Bug #73218: add mitigation for ICU int overflow
Add more locale length checks, due to ICU bugs.
Fix bug #73150: missing NULL check in dom_document_save_html
Clear FG(user_stream_current_filename) when bailing out
set versions and release date
sync NEWS
Revert "Fixed bug #73067 (__debugInfo crashes when throwing an exception)"
Fix for #73240 - Write out of bounds at number_format
Fix bug #73257 and bug #73258 - SplObjectStorage unserialize allows use of non-object as key
set versions
Fix bug #73091 - Unserializing DateInterval object may lead to __toString invocation
Diffstat (limited to 'ext/standard/math.c')
-rw-r--r-- | ext/standard/math.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/standard/math.c b/ext/standard/math.c index 930cd08cb5..753656c56f 100644 --- a/ext/standard/math.c +++ b/ext/standard/math.c @@ -1111,8 +1111,8 @@ PHPAPI zend_string *_php_math_number_format_ex(double d, int dec, char *dec_poin zend_string *tmpbuf; char *s, *t; /* source, target */ char *dp; - int integral; - int reslen = 0; + size_t integral; + size_t reslen = 0; int count = 0; int is_negative=0; @@ -1139,15 +1139,15 @@ PHPAPI zend_string *_php_math_number_format_ex(double d, int dec, char *dec_poin /* calculate the length of the return buffer */ if (dp) { - integral = (int)(dp - ZSTR_VAL(tmpbuf)); + integral = (dp - ZSTR_VAL(tmpbuf)); } else { /* no decimal point was found */ - integral = (int)ZSTR_LEN(tmpbuf); + integral = ZSTR_LEN(tmpbuf); } /* allow for thousand separators */ if (thousand_sep) { - integral += (int)(thousand_sep_len * ((integral-1) / 3)); + integral += thousand_sep_len * ((integral-1) / 3); } reslen = integral; @@ -1156,7 +1156,7 @@ PHPAPI zend_string *_php_math_number_format_ex(double d, int dec, char *dec_poin reslen += dec; if (dec_point) { - reslen += (int)dec_point_len; + reslen += dec_point_len; } } |