From 9552cf6b84b73de38c152b97cc8d30ac3509d4a5 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 16 Feb 2021 15:26:31 +0100 Subject: Handle incomplete result set metadata more gracefully Rather than segfaulting because sname is missing lateron, report a FAIL here. As this indicates a server bug, the errors is reported as an out of band warning, rather than a client error. This fixes the PHP side of bug #80713. --- ext/mysqlnd/mysqlnd_wireprotocol.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ext/mysqlnd/mysqlnd_wireprotocol.c') diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c index 072fdde97a..87b2e7c313 100644 --- a/ext/mysqlnd/mysqlnd_wireprotocol.c +++ b/ext/mysqlnd/mysqlnd_wireprotocol.c @@ -1216,8 +1216,9 @@ php_mysqlnd_rset_field_read(MYSQLND_CONN_DATA * conn, void * _packet) DBG_RETURN(PASS); } else if (EODATA_MARKER == *p && packet->header.size < 8) { /* Premature EOF. That should be COM_FIELD_LIST. But we don't support COM_FIELD_LIST anymore, thus this should not happen */ - DBG_INF("Premature EOF. That should be COM_FIELD_LIST"); - DBG_RETURN(PASS); + DBG_ERR("Premature EOF. That should be COM_FIELD_LIST"); + php_error_docref(NULL, E_WARNING, "Premature EOF in result field metadata"); + DBG_RETURN(FAIL); } meta = packet->metadata; -- cgit v1.2.1