From 6a914cb7a50fafbda38a4d8acce3a06b97dbd994 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Mon, 27 Nov 2023 13:25:11 +0100 Subject: [PATCH] Fix GH-12791: Possible dereference of NULL in MySQLnd debug code Closes GH-12794. --- NEWS | 2 ++ ext/mysqlnd/mysqlnd_result.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 0a39d3f286d61..1a8f3412b3acc 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,8 @@ PHP NEWS - MySQLnd: . Avoid using uninitialised struct. (mikhainin) + . Fixed bug GH-12791 (Possible dereference of NULL in MySQLnd debug code). + (nielsdos) - OpenSSL: . Fixed bug #50713 (openssl_pkcs7_verify() may ignore untrusted CAs). diff --git a/ext/mysqlnd/mysqlnd_result.c b/ext/mysqlnd/mysqlnd_result.c index f96ca410b2323..0331518d7d3d6 100644 --- a/ext/mysqlnd/mysqlnd_result.c +++ b/ext/mysqlnd/mysqlnd_result.c @@ -735,8 +735,8 @@ MYSQLND_METHOD(mysqlnd_res, store_result_fetch_data)(MYSQLND_CONN_DATA * const c UPSERT_STATUS_GET_SERVER_STATUS(conn->upsert_status)); free_end: PACKET_FREE(&row_packet); + DBG_INF_FMT("rows=%llu", (unsigned long long)set->row_count); end: - DBG_INF_FMT("rows=%llu", (unsigned long long)result->stored_data->row_count); DBG_RETURN(ret); } /* }}} */