From: Stanislav Malyshev Date: Thu, 4 Aug 2016 06:00:32 +0000 (-0700) Subject: Merge branch 'PHP-5.6' into PHP-7.0 X-Git-Tag: php-7.1.0beta3~113^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b57474f23efd419a739408ab7a05e49e831e37ad;p=php Merge branch 'PHP-5.6' into PHP-7.0 * PHP-5.6: Fix bug #72716 - initialize buffer before read Conflicts: ext/standard/ftp_fopen_wrapper.c --- b57474f23efd419a739408ab7a05e49e831e37ad diff --cc ext/standard/ftp_fopen_wrapper.c index 10dcdb8006,0d5384e3a5..82875777a0 --- a/ext/standard/ftp_fopen_wrapper.c +++ b/ext/standard/ftp_fopen_wrapper.c @@@ -80,8 -80,9 +80,9 @@@ typedef struct _php_ftp_dirstream_data /* {{{ get_ftp_result */ -static inline int get_ftp_result(php_stream *stream, char *buffer, size_t buffer_size TSRMLS_DC) +static inline int get_ftp_result(php_stream *stream, char *buffer, size_t buffer_size) { + buffer[0] = '\0'; /* in case read fails to read anything */ while (php_stream_gets(stream, buffer, buffer_size-1) && !(isdigit((int) buffer[0]) && isdigit((int) buffer[1]) && isdigit((int) buffer[2]) && buffer[3] == ' ')); @@@ -729,13 -739,13 +730,13 @@@ php_stream * php_stream_ftp_opendir(php php_stream_context_set(datastream, context); if (use_ssl_on_data && (php_stream_xport_crypto_setup(datastream, - STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL TSRMLS_CC) < 0 || - php_stream_xport_crypto_enable(datastream, 1 TSRMLS_CC) < 0)) { + STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL) < 0 || + php_stream_xport_crypto_enable(datastream, 1) < 0)) { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Unable to activate SSL mode"); + php_stream_wrapper_log_error(wrapper, options, "Unable to activate SSL mode"); php_stream_close(datastream); datastream = NULL; - goto opendir_errexit; + goto opendir_errexit; }