From: Georg Richter Date: Sat, 15 Oct 2005 06:32:26 +0000 (+0000) Subject: fixed an error in mysqli_fetch_fields (function returns NULL instead of array X-Git-Tag: php-5.1.0RC3~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b343aa994586bca54c1c23187416455d6e4f24a9;p=php fixed an error in mysqli_fetch_fields (function returns NULL instead of array when row_number > num_fields). Thanks to Marc Deslisle and phpMyAdmin team for the report. --- diff --git a/NEWS b/NEWS index 2b43c886f9..025a0148c6 100644 --- a/NEWS +++ b/NEWS @@ -34,6 +34,8 @@ PHP NEWS - Added "new_link" parameter to mssql_connect() (Bug #34369). (Frank) - Added missing safe_mode checks for image* functions and cURL. (Ilia) - Added missing safe_mode/open_basedir checks for file uploads. (Ilia) +- Fixed an error in mysqli_fetch_fields (returned NULL instead of an + array when row number > field_count). (Georg) - Fixed possible INI setting leak via virtual() in Apache 2 sapi. (Ilia) - Fixed potential GLOBALS overwrite via import_request_variables() and possible crash and/or memory corruption. (Ilia) diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index f4b35014a6..0d62e34487 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -740,10 +740,6 @@ PHP_FUNCTION(mysqli_fetch_fields) MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, &mysql_result, "mysqli_result"); - if (!(field = mysql_fetch_field(result))) { - RETURN_FALSE; - } - array_init(return_value); for (i = 0; i < mysql_num_fields(result); i++) {