Skip to content

Commit 7a4b213

Browse files
committed
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1: Fix error checking in mysqlnd
2 parents 241510c + 0d922aa commit 7a4b213

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ PHP NEWS
4747
. Fixed bug GH-11550 (MySQL Statement has a empty query result when
4848
the response field has changed, also Segmentation fault).
4949
(Yurunsoft)
50+
. Fixed invalid error message "Malformed packet" when connection is dropped.
51+
(Kamil Tekiela)
5052

5153
- Opcache:
5254
. Fixed bug GH-11715 (opcache.interned_strings_buffer either has no effect or

ext/mysqlnd/mysqlnd_protocol_frame_codec.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ MYSQLND_METHOD(mysqlnd_pfc, send)(MYSQLND_PFC * const pfc, MYSQLND_VIO * const v
202202
if (bytes_sent <= 0) {
203203
DBG_ERR_FMT("Can't %zu send bytes", count);
204204
SET_CLIENT_ERROR(error_info, CR_SERVER_GONE_ERROR, UNKNOWN_SQLSTATE, mysqlnd_server_gone);
205+
bytes_sent = 0; // the return type is unsigned and 0 represents an error condition
205206
}
206207
DBG_RETURN(bytes_sent);
207208
}

0 commit comments

Comments
 (0)