Skip to content

Commit 9552cf6

Browse files
committed
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.
1 parent 2d858fb commit 9552cf6

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? 2021, php 7.4.17
44

5+
- MySQLnd:
6+
. Fixed bug #80713 (SegFault when disabling ATTR_EMULATE_PREPARES and
7+
MySQL 8.0). (Nikita)
58

69
04 Mar 2021, php 7.4.16
710

ext/mysqlnd/mysqlnd_wireprotocol.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,8 +1216,9 @@ php_mysqlnd_rset_field_read(MYSQLND_CONN_DATA * conn, void * _packet)
12161216
DBG_RETURN(PASS);
12171217
} else if (EODATA_MARKER == *p && packet->header.size < 8) {
12181218
/* Premature EOF. That should be COM_FIELD_LIST. But we don't support COM_FIELD_LIST anymore, thus this should not happen */
1219-
DBG_INF("Premature EOF. That should be COM_FIELD_LIST");
1220-
DBG_RETURN(PASS);
1219+
DBG_ERR("Premature EOF. That should be COM_FIELD_LIST");
1220+
php_error_docref(NULL, E_WARNING, "Premature EOF in result field metadata");
1221+
DBG_RETURN(FAIL);
12211222
}
12221223

12231224
meta = packet->metadata;

0 commit comments

Comments
 (0)