diff --git a/NEWS b/NEWS index 2b43c886f933c..025a0148c6fc8 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 f4b35014a6150..0d62e34487095 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++) {