com php-src: after merge fixes: ext/mcrypt/mcrypt.c ext/mysqlnd/mysqlnd_result.c ext/mysqlnd/mysqlnd_struct s.h ext/openssl/xp_ssl.c
ext/spl/spl_directory.c
| From: | Anatol Belski | Date: | Sun, 09 Mar 2014 15:17:44 +0000 |
| Subject: | com php-src: after merge fixes: ext/mcrypt/mcrypt.c ext/mysqlnd/mysqlnd_result.c ext/mysqlnd/mysqlnd_struct s.h ext/openssl/xp_ssl.c ext/spl/spl_directory.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-76418@lists.php.net to get a copy of this message | ||
Commit: 2a2649ed0a8a7f33070bd0e1cc84ba2ca2232e71
Author: Anatol Belski <ab@php.net> Sun, 9 Mar 2014 16:17:44 +0100
Parents: 7b8ba8e3e3f3ce3f409439ba104e36105bd779ff
Branches: str_size_and_int64_56_backport
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2a2649ed0a8a7f33070bd0e1cc84ba2ca2232e71
Log:
after merge fixes
Changed paths:
M ext/mcrypt/mcrypt.c
M ext/mysqlnd/mysqlnd_result.c
M ext/mysqlnd/mysqlnd_structs.h
M ext/openssl/xp_ssl.c
M ext/spl/spl_directory.c
diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c index 3a0ce2e..114760f 100644 --- a/ext/mcrypt/mcrypt.c +++ b/ext/mcrypt/mcrypt.c @@ -1147,7 +1147,7 @@ static char *php_mcrypt_get_key_size_str( smart_str_appends(&str, ", "); } - smart_str_append_long(&str, key_sizes[i]); + smart_str_append_int(&str, key_sizes[i]); } smart_str_appends(&str, " supported"); @@ -1299,7 +1299,7 @@ PHP_FUNCTION(mcrypt_encrypt) char *cipher, *key, *data, *mode, *iv = NULL; php_size_t cipher_len, key_len, data_len, mode_len, iv_len = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssss|s", &cipher, &cipher_len, + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SSSS|S", &cipher, &cipher_len, &key, &key_len, &data, &data_len, &mode, &mode_len, &iv, &iv_len) == FAILURE) { return; } @@ -1315,7 +1315,7 @@ PHP_FUNCTION(mcrypt_decrypt) char *cipher, *key, *data, *mode, *iv = NULL; php_size_t cipher_len, key_len, data_len, mode_len, iv_len = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssss|s", &cipher, &cipher_len, + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SSSS|S", &cipher, &cipher_len, &key, &key_len, &data, &data_len, &mode, &mode_len, &iv, &iv_len) == FAILURE) { return; } @@ -1336,7 +1336,7 @@ PHP_FUNCTION(mcrypt_ecb) convert_to_int_ex(mode); - php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "ecb", iv, iv_len, Z_LVAL_PP(mode), return_value TSRMLS_CC); + php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "ecb", iv, iv_len, Z_IVAL_PP(mode), return_value TSRMLS_CC); } /* }}} */ @@ -1352,7 +1352,7 @@ PHP_FUNCTION(mcrypt_cbc) convert_to_int_ex(mode); - php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "cbc", iv, iv_len, Z_LVAL_PP(mode), return_value TSRMLS_CC); + php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "cbc", iv, iv_len, Z_IVAL_PP(mode), return_value TSRMLS_CC); } /* }}} */ @@ -1368,7 +1368,7 @@ PHP_FUNCTION(mcrypt_cfb) convert_to_int_ex(mode); - php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "cfb", iv, iv_len, Z_LVAL_PP(mode), return_value TSRMLS_CC); + php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "cfb", iv, iv_len, Z_IVAL_PP(mode), return_value TSRMLS_CC); } /* }}} */ @@ -1384,7 +1384,7 @@ PHP_FUNCTION(mcrypt_ofb) convert_to_int_ex(mode); - php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "ofb", iv, iv_len, Z_LVAL_PP(mode), return_value TSRMLS_CC); + php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "ofb", iv, iv_len, Z_IVAL_PP(mode), return_value TSRMLS_CC); } /* }}} */ diff --git a/ext/mysqlnd/mysqlnd_result.c b/ext/mysqlnd/mysqlnd_result.c index 226ed6e..abe411d 100644 --- a/ext/mysqlnd/mysqlnd_result.c +++ b/ext/mysqlnd/mysqlnd_result.c @@ -825,7 +825,7 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row)(MYSQLND_RES * result, void for (i = 0; i < field_count; i++, field++) { zval * data = result->unbuf->last_row_data[i]; - php_size_t = (Z_TYPE_P(data) == IS_NULL)? 0:Z_STRSIZE_P(data); + php_size_t len = (Z_TYPE_P(data) == IS_NULL)? 0:Z_STRSIZE_P(data); if (flags & MYSQLND_FETCH_NUM) { Z_ADDREF_P(data); diff --git a/ext/mysqlnd/mysqlnd_structs.h b/ext/mysqlnd/mysqlnd_structs.h index aa6182a..ecea339 100644 --- a/ext/mysqlnd/mysqlnd_structs.h +++ b/ext/mysqlnd/mysqlnd_structs.h @@ -681,7 +681,7 @@ struct st_mysqlnd_res_methods typedef uint64_t (*func_mysqlnd_result_unbuffered__num_rows)(const MYSQLND_RES_UNBUFFERED * const result TSRMLS_DC); -typedef unsigned long * (*func_mysqlnd_result_unbuffered__fetch_lengths)(MYSQLND_RES_UNBUFFERED * const result TSRMLS_DC); +typedef php_uint_t * (*func_mysqlnd_result_unbuffered__fetch_lengths)(MYSQLND_RES_UNBUFFERED * const result TSRMLS_DC); typedef void (*func_mysqlnd_result_unbuffered__free_last_data)(MYSQLND_RES_UNBUFFERED * result, MYSQLND_STATS * const global_stats TSRMLS_DC); typedef void (*func_mysqlnd_result_unbuffered__free_result)(MYSQLND_RES_UNBUFFERED * const result, MYSQLND_STATS * const global_stats TSRMLS_DC); @@ -698,7 +698,7 @@ struct st_mysqlnd_result_unbuffered_methods typedef uint64_t (*func_mysqlnd_result_buffered__num_rows)(const MYSQLND_RES_BUFFERED * const result TSRMLS_DC); typedef enum_func_status (*func_mysqlnd_result_buffered__initialize_result_set_rest)(MYSQLND_RES_BUFFERED * const result, MYSQLND_RES_METADATA * const meta, MYSQLND_STATS * stats, zend_bool int_and_float_native TSRMLS_DC); -typedef unsigned long * (*func_mysqlnd_result_buffered__fetch_lengths)(MYSQLND_RES_BUFFERED * const result TSRMLS_DC); +typedef php_uint_t * (*func_mysqlnd_result_buffered__fetch_lengths)(MYSQLND_RES_BUFFERED * const result TSRMLS_DC); typedef enum_func_status (*func_mysqlnd_result_buffered__data_seek)(MYSQLND_RES_BUFFERED * const result, const uint64_t row TSRMLS_DC); typedef void (*func_mysqlnd_result_buffered__free_result)(MYSQLND_RES_BUFFERED * const result TSRMLS_DC); diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index 4a23764..e0bfcc8 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -65,7 +65,7 @@ /* Simplify ssl context option retrieval */ #define GET_VER_OPT(name) (stream->context && SUCCESS == php_stream_context_get_option(stream->context, "ssl", name, &val)) #define GET_VER_OPT_STRING(name, str) if (GET_VER_OPT(name)) { convert_to_string_ex(val); str = Z_STRVAL_PP(val); } -#define GET_VER_OPT_LONG(name, num) if (GET_VER_OPT(name)) { convert_to_long_ex(val); num = Z_LVAL_PP(val); } +#define GET_VER_OPT_LONG(name, num) if (GET_VER_OPT(name)) { convert_to_int_ex(val); num = Z_IVAL_PP(val); } /* Used for peer verification in windows */ #define PHP_X509_NAME_ENTRY_TO_UTF8(ne, i, out) ASN1_STRING_to_UTF8(&out, X509_NAME_ENTRY_get_data(X509_NAME_get_entry(ne, i))) @@ -464,9 +464,9 @@ static int passwd_callback(char *buf, int num, int verify, void *data) /* {{{ */ GET_VER_OPT_STRING("passphrase", passphrase); if (passphrase) { - if (Z_STRLEN_PP(val) < num - 1) { - memcpy(buf, Z_STRVAL_PP(val), Z_STRLEN_PP(val)+1); - return Z_STRLEN_PP(val); + if (Z_STRSIZE_PP(val) < num - 1) { + memcpy(buf, Z_STRVAL_PP(val), Z_STRSIZE_PP(val)+1); + return Z_STRSIZE_PP(val); } } return 0; @@ -988,8 +988,8 @@ static void init_server_reneg_limit(php_stream *stream, php_openssl_netstream_da SUCCESS == php_stream_context_get_option(stream->context, "ssl", "reneg_limit", &val) ) { - convert_to_long(*val); - limit = Z_LVAL_PP(val); + convert_to_int(*val); + limit = Z_IVAL_PP(val); } /* No renegotiation rate-limiting */ @@ -1001,8 +1001,8 @@ static void init_server_reneg_limit(php_stream *stream, php_openssl_netstream_da SUCCESS == php_stream_context_get_option(stream->context, "ssl", "reneg_window", &val) ) { - convert_to_long(*val); - window = Z_LVAL_PP(val); + convert_to_int(*val); + window = Z_IVAL_PP(val); } sslsock->reneg = (void*)pemalloc(sizeof(php_openssl_handshake_bucket_t), @@ -1026,7 +1026,7 @@ static int set_server_rsa_key(php_stream *stream, SSL_CTX *ctx TSRMLS_DC) /* {{{ RSA* rsa; if (php_stream_context_get_option(stream->context, "ssl", "rsa_key_size", &val) == SUCCESS) { - rsa_key_size = (int) Z_LVAL_PP(val); + rsa_key_size = (int) Z_IVAL_PP(val); if ((rsa_key_size != 1) && (rsa_key_size & (rsa_key_size - 1))) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "RSA key size requires a power of 2: %d", rsa_key_size); rsa_key_size = 2048; @@ -1497,7 +1497,7 @@ static zval *capture_session_meta(SSL *ssl_handle) /* {{{ */ array_init(meta_arr); add_assoc_string(meta_arr, "protocol", proto_str, 1); add_assoc_string(meta_arr, "cipher_name", (char *) SSL_CIPHER_get_name(cipher), 1); - add_assoc_long(meta_arr, "cipher_bits", SSL_CIPHER_get_bits(cipher, NULL)); + add_assoc_int(meta_arr, "cipher_bits", SSL_CIPHER_get_bits(cipher, NULL)); add_assoc_string(meta_arr, "cipher_version", SSL_CIPHER_get_version(cipher), 1); return meta_arr; diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 28d3e5f..1033d48 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -2855,7 +2855,7 @@ SPL_METHOD(SplFileObject, fread) spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); long length = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &length) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i", &length) == FAILURE) { return; } @@ -2865,10 +2865,10 @@ SPL_METHOD(SplFileObject, fread) } Z_STRVAL_P(return_value) = emalloc(length + 1); - Z_STRLEN_P(return_value) = php_stream_read(intern->u.file.stream, Z_STRVAL_P(return_value), length); + Z_STRSIZE_P(return_value) = php_stream_read(intern->u.file.stream, Z_STRVAL_P(return_value), length); /* needed because recv/read/gzread doesnt put a null at the end*/ - Z_STRVAL_P(return_value)[Z_STRLEN_P(return_value)] = 0; + Z_STRVAL_P(return_value)[Z_STRSIZE_P(return_value)] = 0; Z_TYPE_P(return_value) = IS_STRING; }
diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c index 3a0ce2e..114760f 100644 --- a/ext/mcrypt/mcrypt.c +++ b/ext/mcrypt/mcrypt.c @@ -1147,7 +1147,7 @@ static char *php_mcrypt_get_key_size_str( smart_str_appends(&str, ", "); } - smart_str_append_long(&str, key_sizes[i]); + smart_str_append_int(&str, key_sizes[i]); } smart_str_appends(&str, " supported"); @@ -1299,7 +1299,7 @@ PHP_FUNCTION(mcrypt_encrypt) char *cipher, *key, *data, *mode, *iv = NULL; php_size_t cipher_len, key_len, data_len, mode_len, iv_len = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssss|s", &cipher, &cipher_len, + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SSSS|S", &cipher, &cipher_len, &key, &key_len, &data, &data_len, &mode, &mode_len, &iv, &iv_len) == FAILURE) { return; } @@ -1315,7 +1315,7 @@ PHP_FUNCTION(mcrypt_decrypt) char *cipher, *key, *data, *mode, *iv = NULL; php_size_t cipher_len, key_len, data_len, mode_len, iv_len = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssss|s", &cipher, &cipher_len, + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SSSS|S", &cipher, &cipher_len, &key, &key_len, &data, &data_len, &mode, &mode_len, &iv, &iv_len) == FAILURE) { return; } @@ -1336,7 +1336,7 @@ PHP_FUNCTION(mcrypt_ecb) convert_to_int_ex(mode); - php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "ecb", iv, iv_len, Z_LVAL_PP(mode), return_value TSRMLS_CC); + php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "ecb", iv, iv_len, Z_IVAL_PP(mode), return_value TSRMLS_CC); } /* }}} */ @@ -1352,7 +1352,7 @@ PHP_FUNCTION(mcrypt_cbc) convert_to_int_ex(mode); - php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "cbc", iv, iv_len, Z_LVAL_PP(mode), return_value TSRMLS_CC); + php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "cbc", iv, iv_len, Z_IVAL_PP(mode), return_value TSRMLS_CC); } /* }}} */ @@ -1368,7 +1368,7 @@ PHP_FUNCTION(mcrypt_cfb) convert_to_int_ex(mode); - php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "cfb", iv, iv_len, Z_LVAL_PP(mode), return_value TSRMLS_CC); + php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "cfb", iv, iv_len, Z_IVAL_PP(mode), return_value TSRMLS_CC); } /* }}} */ @@ -1384,7 +1384,7 @@ PHP_FUNCTION(mcrypt_ofb) convert_to_int_ex(mode); - php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "ofb", iv, iv_len, Z_LVAL_PP(mode), return_value TSRMLS_CC); + php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "ofb", iv, iv_len, Z_IVAL_PP(mode), return_value TSRMLS_CC); } /* }}} */ diff --git a/ext/mysqlnd/mysqlnd_result.c b/ext/mysqlnd/mysqlnd_result.c index 226ed6e..abe411d 100644 --- a/ext/mysqlnd/mysqlnd_result.c +++ b/ext/mysqlnd/mysqlnd_result.c @@ -825,7 +825,7 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row)(MYSQLND_RES * result, void for (i = 0; i < field_count; i++, field++) { zval * data = result->unbuf->last_row_data[i]; - php_size_t = (Z_TYPE_P(data) == IS_NULL)? 0:Z_STRSIZE_P(data); + php_size_t len = (Z_TYPE_P(data) == IS_NULL)? 0:Z_STRSIZE_P(data); if (flags & MYSQLND_FETCH_NUM) { Z_ADDREF_P(data); diff --git a/ext/mysqlnd/mysqlnd_structs.h b/ext/mysqlnd/mysqlnd_structs.h index aa6182a..ecea339 100644 --- a/ext/mysqlnd/mysqlnd_structs.h +++ b/ext/mysqlnd/mysqlnd_structs.h @@ -681,7 +681,7 @@ struct st_mysqlnd_res_methods typedef uint64_t (*func_mysqlnd_result_unbuffered__num_rows)(const MYSQLND_RES_UNBUFFERED * const result TSRMLS_DC); -typedef unsigned long * (*func_mysqlnd_result_unbuffered__fetch_lengths)(MYSQLND_RES_UNBUFFERED * const result TSRMLS_DC); +typedef php_uint_t * (*func_mysqlnd_result_unbuffered__fetch_lengths)(MYSQLND_RES_UNBUFFERED * const result TSRMLS_DC); typedef void (*func_mysqlnd_result_unbuffered__free_last_data)(MYSQLND_RES_UNBUFFERED * result, MYSQLND_STATS * const global_stats TSRMLS_DC); typedef void (*func_mysqlnd_result_unbuffered__free_result)(MYSQLND_RES_UNBUFFERED * const result, MYSQLND_STATS * const global_stats TSRMLS_DC); @@ -698,7 +698,7 @@ struct st_mysqlnd_result_unbuffered_methods typedef uint64_t (*func_mysqlnd_result_buffered__num_rows)(const MYSQLND_RES_BUFFERED * const result TSRMLS_DC); typedef enum_func_status (*func_mysqlnd_result_buffered__initialize_result_set_rest)(MYSQLND_RES_BUFFERED * const result, MYSQLND_RES_METADATA * const meta, MYSQLND_STATS * stats, zend_bool int_and_float_native TSRMLS_DC); -typedef unsigned long * (*func_mysqlnd_result_buffered__fetch_lengths)(MYSQLND_RES_BUFFERED * const result TSRMLS_DC); +typedef php_uint_t * (*func_mysqlnd_result_buffered__fetch_lengths)(MYSQLND_RES_BUFFERED * const result TSRMLS_DC); typedef enum_func_status (*func_mysqlnd_result_buffered__data_seek)(MYSQLND_RES_BUFFERED * const result, const uint64_t row TSRMLS_DC); typedef void (*func_mysqlnd_result_buffered__free_result)(MYSQLND_RES_BUFFERED * const result TSRMLS_DC); diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index 4a23764..e0bfcc8 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -65,7 +65,7 @@ /* Simplify ssl context option retrieval */ #define GET_VER_OPT(name) (stream->context && SUCCESS == php_stream_context_get_option(stream->context, "ssl", name, &val)) #define GET_VER_OPT_STRING(name, str) if (GET_VER_OPT(name)) { convert_to_string_ex(val); str = Z_STRVAL_PP(val); } -#define GET_VER_OPT_LONG(name, num) if (GET_VER_OPT(name)) { convert_to_long_ex(val); num = Z_LVAL_PP(val); } +#define GET_VER_OPT_LONG(name, num) if (GET_VER_OPT(name)) { convert_to_int_ex(val); num = Z_IVAL_PP(val); } /* Used for peer verification in windows */ #define PHP_X509_NAME_ENTRY_TO_UTF8(ne, i, out) ASN1_STRING_to_UTF8(&out, X509_NAME_ENTRY_get_data(X509_NAME_get_entry(ne, i))) @@ -464,9 +464,9 @@ static int passwd_callback(char *buf, int num, int verify, void *data) /* {{{ */ GET_VER_OPT_STRING("passphrase", passphrase); if (passphrase) { - if (Z_STRLEN_PP(val) < num - 1) { - memcpy(buf, Z_STRVAL_PP(val), Z_STRLEN_PP(val)+1); - return Z_STRLEN_PP(val); + if (Z_STRSIZE_PP(val) < num - 1) { + memcpy(buf, Z_STRVAL_PP(val), Z_STRSIZE_PP(val)+1); + return Z_STRSIZE_PP(val); } } return 0; @@ -988,8 +988,8 @@ static void init_server_reneg_limit(php_stream *stream, php_openssl_netstream_da SUCCESS == php_stream_context_get_option(stream->context, "ssl", "reneg_limit", &val) ) { - convert_to_long(*val); - limit = Z_LVAL_PP(val); + convert_to_int(*val); + limit = Z_IVAL_PP(val); } /* No renegotiation rate-limiting */ @@ -1001,8 +1001,8 @@ static void init_server_reneg_limit(php_stream *stream, php_openssl_netstream_da SUCCESS == php_stream_context_get_option(stream->context, "ssl", "reneg_window", &val) ) { - convert_to_long(*val); - window = Z_LVAL_PP(val); + convert_to_int(*val); + window = Z_IVAL_PP(val); } sslsock->reneg = (void*)pemalloc(sizeof(php_openssl_handshake_bucket_t), @@ -1026,7 +1026,7 @@ static int set_server_rsa_key(php_stream *stream, SSL_CTX *ctx TSRMLS_DC) /* {{{ RSA* rsa; if (php_stream_context_get_option(stream->context, "ssl", "rsa_key_size", &val) == SUCCESS) { - rsa_key_size = (int) Z_LVAL_PP(val); + rsa_key_size = (int) Z_IVAL_PP(val); if ((rsa_key_size != 1) && (rsa_key_size & (rsa_key_size - 1))) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "RSA key size requires a power of 2: %d", rsa_key_size); rsa_key_size = 2048; @@ -1497,7 +1497,7 @@ static zval *capture_session_meta(SSL *ssl_handle) /* {{{ */ array_init(meta_arr); add_assoc_string(meta_arr, "protocol", proto_str, 1); add_assoc_string(meta_arr, "cipher_name", (char *) SSL_CIPHER_get_name(cipher), 1); - add_assoc_long(meta_arr, "cipher_bits", SSL_CIPHER_get_bits(cipher, NULL)); + add_assoc_int(meta_arr, "cipher_bits", SSL_CIPHER_get_bits(cipher, NULL)); add_assoc_string(meta_arr, "cipher_version", SSL_CIPHER_get_version(cipher), 1); return meta_arr; diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 28d3e5f..1033d48 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -2855,7 +2855,7 @@ SPL_METHOD(SplFileObject, fread) spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); long length = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &length) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i", &length) == FAILURE) { return; } @@ -2865,10 +2865,10 @@ SPL_METHOD(SplFileObject, fread) } Z_STRVAL_P(return_value) = emalloc(length + 1); - Z_STRLEN_P(return_value) = php_stream_read(intern->u.file.stream, Z_STRVAL_P(return_value), length); + Z_STRSIZE_P(return_value) = php_stream_read(intern->u.file.stream, Z_STRVAL_P(return_value), length); /* needed because recv/read/gzread doesnt put a null at the end*/ - Z_STRVAL_P(return_value)[Z_STRLEN_P(return_value)] = 0; + Z_STRVAL_P(return_value)[Z_STRSIZE_P(return_value)] = 0; Z_TYPE_P(return_value) = IS_STRING; }