summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2005-08-06 16:15:53 +0000
committerAndrey Hristov <andrey@php.net>2005-08-06 16:15:53 +0000
commitdcc18b6d6f77b60211c54e82a9a708fc04cee207 (patch)
treecf322e5bbe0a40c6854f609b53fa744aae4e8d27
parent7675a858286e9694a82f566cc4e05661d2bd3988 (diff)
downloadphp-git-dcc18b6d6f77b60211c54e82a9a708fc04cee207.tar.gz
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.
-rw-r--r--ext/mysqli/mysqli_nonapi.c2
1 files changed, 1 insertions, 1 deletions
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;