]> granicus.if.org Git - php/commitdiff
fix problem on 64 bit - when asking for "l" supply long not int because
authorAndrey Hristov <andrey@php.net>
Sat, 6 Aug 2005 16:15:53 +0000 (16:15 +0000)
committerAndrey Hristov <andrey@php.net>
Sat, 6 Aug 2005 16:15:53 +0000 (16:15 +0000)
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.

ext/mysqli/mysqli_nonapi.c

index 63979d980ac1d339e849ef30077be545cabb3151..7387b2e60bae61f17a6bb9edcbcf872d76e11368 100644 (file)
@@ -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;