From: Andrey Hristov Date: Sat, 6 Aug 2005 16:15:53 +0000 (+0000) Subject: fix problem on 64 bit - when asking for "l" supply long not int because X-Git-Tag: RELEASE_2_0_0~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dcc18b6d6f77b60211c54e82a9a708fc04cee207;p=php fix problem on 64 bit - when asking for "l" supply long not int because on 64 bit they differ and zend_parse_parameters makes a *(long*) cast which means that if the variable is int 4 bytes of the variable(s) declared before it (on the stack) will be overwritten. In this case this is the length of the query -> made 0 and mysqli_query() returns FALSE. --- diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c index 63979d980a..7387b2e60b 100644 --- a/ext/mysqli/mysqli_nonapi.c +++ b/ext/mysqli/mysqli_nonapi.c @@ -213,7 +213,7 @@ PHP_FUNCTION(mysqli_query) MYSQL_RES *result; char *query = NULL; unsigned int query_len; - unsigned int resultmode = 0; + unsigned long resultmode = 0; 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;