Commit 5774f0edaa1 for php.net

commit 5774f0edaa1db09cc02030b6348bef4b5d4bf4c2
Author: Daniel Scherzer <daniel.e.scherzer+phpf@gmail.com>
Date:   Thu Sep 17 18:15:03 2026 -0700

    ext/mysqlnd: add a hardening assertion that the fetch callback is set (#23716)

    Given that the knowledge that the fetch callback is not null is based on
    validation that was done separately, and there are indeed entries in
    `mysqlnd_ps_fetch_functions` where the callback is null, add a `ZEND_ASSERT`
    that the function is not null as a hardening measure.

diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c
index b957240a408..c779f747ec8 100644
--- a/ext/mysqlnd/mysqlnd_wireprotocol.c
+++ b/ext/mysqlnd/mysqlnd_wireprotocol.c
@@ -1497,7 +1497,10 @@ php_mysqlnd_rowp_read_binary_protocol(MYSQLND_ROW_BUFFER * row_buffer, zval * fi
 				php_error_docref(NULL, E_WARNING, "Malformed server packet. No packet space left for the field");
 				DBG_RETURN(FAIL);
 			}
-			mysqlnd_ps_fetch_functions[type].func(current_field, &fields_metadata[i], rbs - row_position, &p);
+			const ps_field_fetch_func type_fetch = mysqlnd_ps_fetch_functions[type].func;
+			/* Some agents think that this can be null. */
+			ZEND_ASSERT(type_fetch != NULL && "Type was validated, known types have functions set properly");
+			type_fetch(current_field, &fields_metadata[i], rbs - row_position, &p);
 			if (p == NULL) {
 				for (j = 0, current_field = start_field; j < i; current_field++, j++) {
 					zval_ptr_dtor(current_field);