[PHP-CVS] com php-src: Fix to file uploads 2G with size overflow: main/rfc1867.c
Commit:9d4e5b0dbab21ecba3536136ce8241862fa813b0 Author:Anatol Belski a...@php.net Wed, 14 Aug 2013 18:59:46 +0200 Parents: 4da62730927ea469e74577a269072ed1069ab05f Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9d4e5b0dbab21ecba3536136ce8241862fa813b0 Log: Fix to file uploads 2G with size overflow Represent the file size as string when the total size would overflow LONG_MAX. Otherwise while file itself were uploaded, the size would be shown wrong. This mostly applies to systems with 32 bit long. Changed paths: M main/rfc1867.c Diff: diff --git a/main/rfc1867.c b/main/rfc1867.c index 3c16070..498b597 100644 --- a/main/rfc1867.c +++ b/main/rfc1867.c @@ -1215,17 +1215,32 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */ { zval file_size, error_type; + int size_overflow = 0; + char file_size_buf[65]; - error_type.value.lval = cancel_upload; - error_type.type = IS_LONG; + ZVAL_LONG(error_type, cancel_upload); /* Add $foo[error] */ if (cancel_upload) { - file_size.value.lval = 0; - file_size.type = IS_LONG; + ZVAL_LONG(file_size, 0); } else { - file_size.value.lval = total_bytes; - file_size.type = IS_LONG; + if (total_bytes LONG_MAX) { +#ifdef PHP_WIN32 + if (_i64toa_s(total_bytes, file_size_buf, 65, 10)) { + file_size_buf[0] = '0'; + file_size_buf[1] = '\0'; + } +#else + { + int __len = snprintf(file_size_buf, 65, %lld, total_bytes); + file_size_buf[__len] = '\0'; + } +#endif + size_overflow = 1; + + } else { + ZVAL_LONG(file_size, total_bytes); + } } if (is_arr_upload) { @@ -1242,7 +1257,10 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */ snprintf(lbuf, llen, %s_size, param); } if (!is_anonymous) { - safe_php_register_variable_ex(lbuf, file_size, NULL, 0 TSRMLS_CC); + if (size_overflow) { + ZVAL_STRING(file_size, file_size_buf, 1); + } + safe_php_register_variable_ex(lbuf, file_size, NULL, size_overflow TSRMLS_CC); } /* Add $foo[size] */ @@ -1251,7 +1269,10 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */ } else { snprintf(lbuf, llen, %s[size], param); } - register_http_post_files_variable_ex(lbuf, file_size, http_post_files, 0 TSRMLS_CC); + if (size_overflow) { + ZVAL_STRING(file_size, file_size_buf, 1); + } + register_http_post_files_variable_ex(lbuf, file_size, http_post_files, size_overflow TSRMLS_CC); } efree(param); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Skip test if SKIP_ONLINE_TESTS set: ext/standard/tests/file/file_get_contents_error001.phpt
Commit:9d62807190ebda858acbb09ad832c96570a97c40 Author:Christopher Jones s...@php.net Wed, 14 Aug 2013 15:45:06 -0700 Parents: 7f69f07fc18f750843e756668a1a8a9178cdef97 Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9d62807190ebda858acbb09ad832c96570a97c40 Log: Skip test if SKIP_ONLINE_TESTS set Changed paths: M ext/standard/tests/file/file_get_contents_error001.phpt Diff: diff --git a/ext/standard/tests/file/file_get_contents_error001.phpt b/ext/standard/tests/file/file_get_contents_error001.phpt index 127901a..a347d9d 100644 --- a/ext/standard/tests/file/file_get_contents_error001.phpt +++ b/ext/standard/tests/file/file_get_contents_error001.phpt @@ -10,6 +10,7 @@ display_errors=false if (getenv(SKIP_SLOW_TESTS)) die(skip slow test); if (!function_exists(file_get_contents)) die (skip file_get_contents function is not found); + if (getenv(SKIP_ONLINE_TESTS)) die(skip online test); ? --FILE-- ?php -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed #65431 in zend_exception.c by Sixd: Zend/zend_exceptions.c
Commit:8280393828e31913da45ba5ae5efbce34d90f8a8 Author:Xinchen Hui larue...@php.net Thu, 15 Aug 2013 11:47:44 +0800 Parents: 9d62807190ebda858acbb09ad832c96570a97c40 Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8280393828e31913da45ba5ae5efbce34d90f8a8 Log: Fixed #65431 in zend_exception.c by Sixd Bugs: https://bugs.php.net/65431 Changed paths: M Zend/zend_exceptions.c Diff: diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index f07c113..14ae75e 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -85,12 +85,12 @@ void zend_throw_exception_internal(zval *exception TSRMLS_DC) /* {{{ */ { #ifdef HAVE_DTRACE if (DTRACE_EXCEPTION_THROWN_ENABLED()) { - char *classname; - int name_len; + const char *classname; + zend_uint name_len; if (exception != NULL) { zend_get_object_classname(exception, classname, name_len TSRMLS_CC); - DTRACE_EXCEPTION_THROWN(classname); + DTRACE_EXCEPTION_THROWN((char *)classname); } else { DTRACE_EXCEPTION_THROWN(NULL); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Reduce (some) compile noise of 'unused variable' and 'may be used uninitialized' warnings.: ext/date/php_date.c ext/dba/dba.c ext/dba/libinifile/inifile.c ext/dom/xpath.c ext/gm
Commit:9ad97cd48903ea5454853960f2c14de326e0f624 Author:Christopher Jones s...@php.net Wed, 14 Aug 2013 20:36:50 -0700 Parents: 9d62807190ebda858acbb09ad832c96570a97c40 Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9ad97cd48903ea5454853960f2c14de326e0f624 Log: Reduce (some) compile noise of 'unused variable' and 'may be used uninitialized' warnings. Changed paths: M ext/date/php_date.c M ext/dba/dba.c M ext/dba/libinifile/inifile.c M ext/dom/xpath.c M ext/gmp/gmp.c M ext/intl/grapheme/grapheme_util.c M ext/intl/resourcebundle/resourcebundle_class.c M ext/openssl/openssl.c M ext/openssl/xp_ssl.c M ext/session/session.c M ext/simplexml/simplexml.c M ext/snmp/snmp.c M ext/spl/spl_array.c M ext/spl/spl_dllist.c M ext/standard/array.c M ext/standard/html.c M ext/standard/string.c M ext/standard/url_scanner_ex.re M ext/xsl/xsltprocessor.c M ext/zip/php_zip.c M main/php_variables.c M main/rfc1867.c M sapi/cli/php_cli_server.c diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 270c058..f091fed 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -997,7 +997,7 @@ char *php_date_short_day_name(timelib_sll y, timelib_sll m, timelib_sll d) static char *date_format(char *format, int format_len, timelib_time *t, int localtime) { smart_strstring = {0}; - int i, length; + int i, length = 0; char buffer[97]; timelib_time_offset *offset = NULL; timelib_sll isoweek, isoyear; @@ -2409,8 +2409,8 @@ PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str, timelib_time *now; timelib_tzinfo *tzi = NULL; timelib_error_container *err = NULL; - int type = TIMELIB_ZONETYPE_ID, new_dst; - char *new_abbr; + int type = TIMELIB_ZONETYPE_ID, new_dst = 0; + char *new_abbr = NULL; timelib_sll new_offset; if (dateobj-time) { diff --git a/ext/dba/dba.c b/ext/dba/dba.c index 5295ab3..8005101 100644 --- a/ext/dba/dba.c +++ b/ext/dba/dba.c @@ -538,7 +538,6 @@ PHP_MINFO_FUNCTION(dba) */ static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode) { - char *v; int val_len; zval *id; dba_info *info = NULL; diff --git a/ext/dba/libinifile/inifile.c b/ext/dba/libinifile/inifile.c index 89373b1..3cd9770 100644 --- a/ext/dba/libinifile/inifile.c +++ b/ext/dba/libinifile/inifile.c @@ -460,7 +460,7 @@ static int inifile_filter(inifile *dba, inifile *from, const key_type *key TSRML */ static int inifile_delete_replace_append(inifile *dba, const key_type *key, const val_type *value, int append TSRMLS_DC) { - size_t pos_grp_start, pos_grp_next; + size_t pos_grp_start = 0, pos_grp_next; inifile *ini_tmp = NULL; php_stream *fp_tmp = NULL; int ret; diff --git a/ext/dom/xpath.c b/ext/dom/xpath.c index cf556a3..d12ef30 100644 --- a/ext/dom/xpath.c +++ b/ext/dom/xpath.c @@ -74,7 +74,7 @@ const zend_function_entry php_dom_xpath_class_functions[] = { static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int type) /* {{{ */ { - zval **args; + zval **args = NULL; zval *retval; int result, i, ret; int error = 0; diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c index f8c3a07..e3a3563 100644 --- a/ext/gmp/gmp.c +++ b/ext/gmp/gmp.c @@ -1069,7 +1069,7 @@ ZEND_FUNCTION(gmp_powm) zval **base_arg, **exp_arg, **mod_arg; mpz_t *gmpnum_base, *gmpnum_exp, *gmpnum_mod, *gmpnum_result; int use_ui = 0; - int temp_base, temp_exp, temp_mod; + int temp_base = 0, temp_exp = 0, temp_mod; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ZZZ, base_arg, exp_arg, mod_arg) == FAILURE){ return; diff --git a/ext/intl/grapheme/grapheme_util.c b/ext/intl/grapheme/grapheme_util.c index 883fa03..c752b02 100644 --- a/ext/intl/grapheme/grapheme_util.c +++ b/ext/intl/grapheme/grapheme_util.c @@ -130,7 +130,7 @@ void grapheme_substr_ascii(char *str, int str_len, int f, int l, int argc, char /* {{{ grapheme_strpos_utf16 - strrpos using utf16*/ int grapheme_strpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int32_t *puchar_pos, int f_ignore_case, int last TSRMLS_DC) { - UChar *uhaystack = NULL, *puhaystack, *uneedle = NULL; + UChar *uhaystack = NULL, *uneedle = NULL; int32_t uhaystack_len = 0, uneedle_len = 0, char_pos, ret_pos, offset_pos = 0; unsigned char u_break_iterator_buffer[U_BRK_SAFECLONE_BUFFERSIZE]; UBreakIterator* bi = NULL; diff --git a/ext/intl/resourcebundle/resourcebundle_class.c b/ext/intl/resourcebundle/resourcebundle_class.c index a6a73f5..7c1a5c2 100644 ---
[PHP-CVS] com php-src: Reduce compiler noise by removing unused variables and labels: ext/gd/gd.c ext/gd/libgd/gd.c ext/standard/url_scanner_ex.c
Commit:cd14de94d2428a28c8bfad1aad9837c59ab81e8f Author:Christopher Jones s...@php.net Wed, 14 Aug 2013 21:06:59 -0700 Parents: 39612afc72623e89a2bc595c9be4be497568d1be Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cd14de94d2428a28c8bfad1aad9837c59ab81e8f Log: Reduce compiler noise by removing unused variables and labels Changed paths: M ext/gd/gd.c M ext/gd/libgd/gd.c M ext/standard/url_scanner_ex.c Diff: diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 8f32ad5..fb25821 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -2434,7 +2434,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type, fflush(fp); } -register_im: +/* register_im: */ if (im) { ZEND_REGISTER_RESOURCE(return_value, im, le_gd); php_stream_close(stream); diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c index 7ed6617..54890bc 100644 --- a/ext/gd/libgd/gd.c +++ b/ext/gd/libgd/gd.c @@ -3011,7 +3011,6 @@ void gdImageGetClip (gdImagePtr im, int *x1P, int *y1P, int *x2P, int *y2P) int gdImagePaletteToTrueColor(gdImagePtr src) { unsigned int y; - unsigned char alloc_y = 0; unsigned int yy; if (src == NULL) { diff --git a/ext/standard/url_scanner_ex.c b/ext/standard/url_scanner_ex.c index 833e9d8..2c2dfda 100644 --- a/ext/standard/url_scanner_ex.c +++ b/ext/standard/url_scanner_ex.c @@ -1011,7 +1011,7 @@ static void php_url_scanner_output_handler(char *output, uint output_len, char * PHPAPI int php_url_scanner_add_var(char *name, int name_len, char *value, int value_len, int urlencode TSRMLS_DC) { - char *encoded; + char *encoded = NULL; int encoded_len; smart_str val; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/date/php_date.c ext/intl/resourcebundle/resourcebundle_class.c ext/openssl/openssl.c ext/openssl/xp_ssl.c ext/session/session.c ext/simp
Commit:39612afc72623e89a2bc595c9be4be497568d1be Author:Christopher Jones s...@php.net Wed, 14 Aug 2013 20:43:25 -0700 Parents: 8c61758dc772345636e436e3f69bef7323f8b339 9ad97cd48903ea5454853960f2c14de326e0f624 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=39612afc72623e89a2bc595c9be4be497568d1be Log: Merge branch 'PHP-5.4' into PHP-5.5 * PHP-5.4: Reduce (some) compile noise of 'unused variable' and 'may be used uninitialized' warnings. Conflicts: ext/dba/libinifile/inifile.c Changed paths: MM ext/date/php_date.c MM ext/intl/resourcebundle/resourcebundle_class.c MM ext/openssl/openssl.c MM ext/openssl/xp_ssl.c MM ext/session/session.c MM ext/simplexml/simplexml.c MM ext/snmp/snmp.c MM ext/spl/spl_array.c MM ext/spl/spl_dllist.c MM ext/standard/array.c MM ext/standard/string.c MM ext/zip/php_zip.c MM main/php_variables.c MM main/rfc1867.c MM sapi/cli/php_cli_server.c Diff: diff --cc ext/openssl/openssl.c index 05e1e79,68be86f..4c3b2ec --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@@ -588,10 -575,10 +588,10 @@@ static void add_assoc_name_entry(zval } else { subitem = val; } - + for (i = 0; i X509_NAME_entry_count(name); i++) { unsigned char *to_add; - int to_add_len; + int to_add_len = 0; ne = X509_NAME_get_entry(name, i); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Remove unused variable: ext/openssl/openssl.c
Commit:ac03b67e6a04f4337dcaa0ef0061afaa57c70e12 Author:Christopher Jones s...@php.net Wed, 14 Aug 2013 21:21:17 -0700 Parents: 4824d0f43e6d8742eafb5e751f3c9a3d7da3f3cd Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ac03b67e6a04f4337dcaa0ef0061afaa57c70e12 Log: Remove unused variable Changed paths: M ext/openssl/openssl.c Diff: diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index e4000bc..cc6c79a 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -1529,7 +1529,6 @@ PHP_FUNCTION(openssl_spki_export) EVP_PKEY *pkey = NULL; NETSCAPE_SPKI *spki = NULL; BIO *out = BIO_new(BIO_s_mem()); - BUF_MEM *bio_buf; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, spkstr, spkstr_len) == FAILURE) { return; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.5': ext/gd/gd.c
Commit:4824d0f43e6d8742eafb5e751f3c9a3d7da3f3cd Author:Christopher Jones s...@php.net Wed, 14 Aug 2013 21:08:55 -0700 Parents: 3c166c47584c7a7eb8c1ce42ea05a8a5677da028 cd14de94d2428a28c8bfad1aad9837c59ab81e8f Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4824d0f43e6d8742eafb5e751f3c9a3d7da3f3cd Log: Merge branch 'PHP-5.5' * PHP-5.5: Reduce compiler noise by removing unused variables and labels Changed paths: MM ext/gd/gd.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.5': ext/gmp/gmp.c ext/openssl/openssl.c ext/openssl/xp_ssl.c ext/session/session.c ext/standard/string.c ext/zip/php_zip.c main/rfc1867.c
Commit:3c166c47584c7a7eb8c1ce42ea05a8a5677da028 Author:Christopher Jones s...@php.net Wed, 14 Aug 2013 20:47:00 -0700 Parents: 759517651ec5fb09349a3653435dc9ddd0fc53b5 39612afc72623e89a2bc595c9be4be497568d1be Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3c166c47584c7a7eb8c1ce42ea05a8a5677da028 Log: Merge branch 'PHP-5.5' * PHP-5.5: Reduce (some) compile noise of 'unused variable' and 'may be used uninitialized' warnings. Conflicts: ext/gmp/gmp.c Changed paths: MM ext/gmp/gmp.c MM ext/openssl/openssl.c MM ext/openssl/xp_ssl.c MM ext/session/session.c MM ext/standard/string.c MM ext/zip/php_zip.c MM main/rfc1867.c Diff: diff --cc ext/gmp/gmp.c index 6b3dadf,e3a3563..8b5c131 --- a/ext/gmp/gmp.c +++ b/ext/gmp/gmp.c @@@ -1360,12 -1066,12 +1360,12 @@@ ZEND_FUNCTION(gmp_pow Raise base to power exp and take result modulo mod */ ZEND_FUNCTION(gmp_powm) { - zval **base_arg, **exp_arg, **mod_arg; - mpz_t *gmpnum_base, *gmpnum_exp, *gmpnum_mod, *gmpnum_result; + zval *base_arg, *exp_arg, *mod_arg; + mpz_ptr gmpnum_base, gmpnum_exp, gmpnum_mod, gmpnum_result; int use_ui = 0; - gmp_temp_t temp_base, temp_exp, temp_mod; - int temp_base = 0, temp_exp = 0, temp_mod; ++ gmp_temp_t temp_base = {0}, temp_exp = {0}, temp_mod; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ZZZ, base_arg, exp_arg, mod_arg) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, zzz, base_arg, exp_arg, mod_arg) == FAILURE){ return; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php