From b343aa994586bca54c1c23187416455d6e4f24a9 Mon Sep 17 00:00:00 2001 From: Georg Richter Date: Sat, 15 Oct 2005 06:32:26 +0000 Subject: [PATCH] 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. --- NEWS | 2 ++ ext/mysqli/mysqli_api.c | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) 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++) { -- 2.40.0