cvs: php-src(PHP_5_0) /ext/mysqli mysqli.c

From: Date: Thu, 27 Jan 2005 14:39:21 +0000
Subject: cvs: php-src(PHP_5_0) /ext/mysqli mysqli.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-30177@lists.php.net to get a copy of this message
tony2001 Thu Jan 27 09:39:21 2005 EDT Modified files: (Branch: PHP_5_0) /php-src/ext/mysqli mysqli.c Log: fix leak in mysqli_fetch_array() when using invalid resulttype http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli.c?r1=1.43.2.10&r2=1.43.2.11&ty=u Index: php-src/ext/mysqli/mysqli.c diff -u php-src/ext/mysqli/mysqli.c:1.43.2.10 php-src/ext/mysqli/mysqli.c:1.43.2.11 --- php-src/ext/mysqli/mysqli.c:1.43.2.10 Sat Dec 25 11:44:02 2004 +++ php-src/ext/mysqli/mysqli.c Thu Jan 27 09:39:21 2005 @@ -15,7 +15,7 @@ | Author: Georg Richter <georg@php.net> | +----------------------------------------------------------------------+ - $Id: mysqli.c,v 1.43.2.10 2004/12/25 16:44:02 georg Exp $ + $Id: mysqli.c,v 1.43.2.11 2005/01/27 14:39:21 tony2001 Exp $ */ #ifdef HAVE_CONFIG_H @@ -623,6 +623,11 @@ MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, &mysql_result, "mysqli_result"); + if ((fetchtype & MYSQLI_BOTH) == 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The result type should be either MYSQLI_NUM, MYSQLI_ASSOC or MYSQLI_BOTH"); + RETURN_FALSE; + } + if (!(row = mysql_fetch_row(result))) { RETURN_NULL(); }

« previous php.cvs (#30177) next »