Skip to content

Commit 0d922aa

Browse files
committed
Fix error checking in mysqlnd
Closes GH-11925
1 parent 248e6b0 commit 0d922aa

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

NEWS

+2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ PHP NEWS
4242
. Fixed bug GH-11550 (MySQL Statement has a empty query result when
4343
the response field has changed, also Segmentation fault).
4444
(Yurunsoft)
45+
. Fixed invalid error message "Malformed packet" when connection is dropped.
46+
(Kamil Tekiela)
4547

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

ext/mysqlnd/mysqlnd_protocol_frame_codec.c

+1
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)