From: Nikita Popov Date: Thu, 18 Sep 2014 21:00:14 +0000 (+0200) Subject: Fix GMP serialization X-Git-Tag: POST_NATIVE_TLS_MERGE^2~214 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8a9dd4a1d75a9b8929914c383ef55dec2c455551;p=php Fix GMP serialization Also fix same issue in PDO. --- diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c index 7eb9eef494..2d4b5fc8c1 100644 --- a/ext/gmp/gmp.c +++ b/ext/gmp/gmp.c @@ -569,7 +569,7 @@ static int gmp_compare(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ } /* }}} */ -static int gmp_serialize(zval *object, unsigned char **buffer, uint32_t *buf_len, zend_serialize_data *data TSRMLS_DC) /* {{{ */ +static int gmp_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data TSRMLS_DC) /* {{{ */ { mpz_ptr gmpnum = GET_GMP_FROM_ZVAL(object); smart_str buf = {0}; @@ -596,7 +596,7 @@ static int gmp_serialize(zval *object, unsigned char **buffer, uint32_t *buf_len } /* }}} */ -static int gmp_unserialize(zval *object, zend_class_entry *ce, const unsigned char *buf, uint32_t buf_len, zend_unserialize_data *data TSRMLS_DC) /* {{{ */ +static int gmp_unserialize(zval *object, zend_class_entry *ce, const unsigned char *buf, size_t buf_len, zend_unserialize_data *data TSRMLS_DC) /* {{{ */ { mpz_ptr gmpnum; const unsigned char *p, *max; diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index dd8b01a5b4..b0aa35fda7 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -2267,7 +2267,7 @@ static zend_object *dbstmt_clone_obj(zval *zobject TSRMLS_DC) } zend_object_handlers pdo_dbstmt_object_handlers; -static int pdo_row_serialize(zval *object, unsigned char **buffer, uint32_t *buf_len, zend_serialize_data *data TSRMLS_DC); +static int pdo_row_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data TSRMLS_DC); void pdo_stmt_init(TSRMLS_D) { @@ -2700,7 +2700,7 @@ zend_object *pdo_row_new(zend_class_entry *ce TSRMLS_DC) return &row->std; } -static int pdo_row_serialize(zval *object, unsigned char **buffer, uint32_t *buf_len, zend_serialize_data *data TSRMLS_DC) +static int pdo_row_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data TSRMLS_DC) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "PDORow instances may not be serialized"); return FAILURE; diff --git a/main/php_version.h b/main/php_version.h index 186d9d2b7d..d48ab24141 100644 --- a/main/php_version.h +++ b/main/php_version.h @@ -6,4 +6,3 @@ #define PHP_EXTRA_VERSION "-dev" #define PHP_VERSION "7.0.0-dev" #define PHP_VERSION_ID 70000 -