cvs: php-src /ext/mysqli mysqli_nonapi.c
| From: | Andrey Hristov | Date: | Sat, 06 Aug 2005 16:15:55 +0000 |
| Subject: | cvs: php-src /ext/mysqli mysqli_nonapi.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-33191@lists.php.net to get a copy of this message | ||
andrey Sat Aug 6 12:15:55 2005 EDT
Modified files:
/php-src/ext/mysqli mysqli_nonapi.c
Log:
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.
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_nonapi.c?r1=1.51&r2=1.52&ty=u
Index: php-src/ext/mysqli/mysqli_nonapi.c
diff -u php-src/ext/mysqli/mysqli_nonapi.c:1.51 php-src/ext/mysqli/mysqli_nonapi.c:1.52
--- php-src/ext/mysqli/mysqli_nonapi.c:1.51 Wed Aug 3 10:07:30 2005
+++ php-src/ext/mysqli/mysqli_nonapi.c Sat Aug 6 12:15:53 2005
@@ -15,7 +15,7 @@
| Author: Georg Richter <georg@php.net> |
+----------------------------------------------------------------------+
- $Id: mysqli_nonapi.c,v 1.51 2005/08/03 14:07:30 sniper Exp $
+ $Id: mysqli_nonapi.c,v 1.52 2005/08/06 16:15:53 andrey Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -213,7 +213,7 @@
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;