summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2021-02-16 15:26:31 +0100
committerNikita Popov <nikita.ppv@gmail.com>2021-02-16 15:34:14 +0100
commit9552cf6b84b73de38c152b97cc8d30ac3509d4a5 (patch)
tree64ba43f49165a45fbcad3c3065f61cd5b7f654a7
parent2d858fbfb19231f3ecc80c1419d028881a12b1dd (diff)
downloadphp-git-9552cf6b84b73de38c152b97cc8d30ac3509d4a5.tar.gz
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.
-rw-r--r--NEWS3
-rw-r--r--ext/mysqlnd/mysqlnd_wireprotocol.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index fd18d5859c..3d4f1c5d87 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,9 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2021, php 7.4.17
+- MySQLnd:
+ . Fixed bug #80713 (SegFault when disabling ATTR_EMULATE_PREPARES and
+ MySQL 8.0). (Nikita)
04 Mar 2021, php 7.4.16
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;