From 77d160772fd31c1763c385c86437126382c602f4 Mon Sep 17 00:00:00 2001 From: Andrey Hristov Date: Wed, 10 Nov 2010 13:57:09 +0000 Subject: [PATCH] Fix bad types, because zend_parse_xxx expect signed integers for lengths, no matter how stupid this is :) --- ext/mysqli/mysqli_api.c | 10 +++++----- ext/mysqli/mysqli_nonapi.c | 28 ++++++++++++++-------------- ext/mysqli/mysqli_report.c | 2 +- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index f9fbc088d02..a54b15cdbc0 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -1763,7 +1763,7 @@ PHP_FUNCTION(mysqli_prepare) MY_MYSQL *mysql; MY_STMT *stmt; char *query = NULL; - unsigned int query_len; + int query_len; zval *mysql_link; MYSQLI_RESOURCE *mysqli_resource; @@ -1847,10 +1847,10 @@ PHP_FUNCTION(mysqli_real_connect) Binary-safe version of mysql_query() */ PHP_FUNCTION(mysqli_real_query) { - MY_MYSQL *mysql; - zval *mysql_link; - char *query = NULL; - unsigned int query_len; + MY_MYSQL *mysql; + zval *mysql_link; + char *query = NULL; + int query_len; if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_link, mysqli_link_class_entry, &query, &query_len) == FAILURE) { return; diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c index 3fdb6b276ba..72b242a662d 100644 --- a/ext/mysqli/mysqli_nonapi.c +++ b/ext/mysqli/mysqli_nonapi.c @@ -62,7 +62,7 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne MYSQLI_RESOURCE *mysqli_resource = NULL; zval *object = getThis(); char *hostname = NULL, *username=NULL, *passwd=NULL, *dbname=NULL, *socket=NULL; - unsigned int hostname_len = 0, username_len = 0, passwd_len = 0, dbname_len = 0, socket_len = 0; + int hostname_len = 0, username_len = 0, passwd_len = 0, dbname_len = 0, socket_len = 0; zend_bool persistent = FALSE; long port = 0, flags = 0; uint hash_len; @@ -362,9 +362,9 @@ PHP_FUNCTION(mysqli_fetch_assoc) #if defined(MYSQLI_USE_MYSQLND) PHP_FUNCTION(mysqli_fetch_all) { - MYSQL_RES *result; - zval *mysql_result; - long mode = MYSQLND_FETCH_NUM; + MYSQL_RES *result; + zval *mysql_result; + long mode = MYSQLND_FETCH_NUM; if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|l", &mysql_result, mysqli_result_class_entry, &mode) == FAILURE) { return; @@ -437,10 +437,10 @@ PHP_FUNCTION(mysqli_fetch_object) allows to execute multiple queries */ PHP_FUNCTION(mysqli_multi_query) { - MY_MYSQL *mysql; - zval *mysql_link; - char *query = NULL; - unsigned int query_len; + MY_MYSQL *mysql; + zval *mysql_link; + char *query = NULL; + int query_len; if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_link, mysqli_link_class_entry, &query, &query_len) == FAILURE) { return; @@ -485,8 +485,8 @@ PHP_FUNCTION(mysqli_query) MYSQLI_RESOURCE *mysqli_resource; MYSQL_RES *result; char *query = NULL; - unsigned int query_len; - unsigned long resultmode = MYSQLI_STORE_RESULT; + int query_len; + long resultmode = MYSQLI_STORE_RESULT; if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|l", &mysql_link, mysqli_link_class_entry, &query, &query_len, &resultmode) == FAILURE) { return; @@ -873,10 +873,10 @@ PHP_FUNCTION(mysqli_stmt_get_warnings) sets client character set */ PHP_FUNCTION(mysqli_set_charset) { - MY_MYSQL *mysql; - zval *mysql_link; - char *cs_name; - int csname_len; + MY_MYSQL *mysql; + zval *mysql_link; + char *cs_name; + int csname_len; if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_link, mysqli_link_class_entry, &cs_name, &csname_len) == FAILURE) { return; diff --git a/ext/mysqli/mysqli_report.c b/ext/mysqli/mysqli_report.c index 6cd5e74a42b..2fd873f0786 100644 --- a/ext/mysqli/mysqli_report.c +++ b/ext/mysqli/mysqli_report.c @@ -33,7 +33,7 @@ extern void php_mysqli_throw_sql_exception(char *sqlstate, int errorno TSRMLS_DC sets report level */ PHP_FUNCTION(mysqli_report) { - long flags; + long flags; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &flags) == FAILURE) {