diff -up libssh2-1.8.0/src/transport.c.diff libssh2-1.8.0/src/transport.c
--- libssh2-1.8.0/src/transport.c.diff 2023-09-20 12:21:55.121219631 -0400
+++ libssh2-1.8.0/src/transport.c 2023-09-20 12:24:26.694051411 -0400
@@ -460,7 +460,7 @@ int _libssh2_transport_read(LIBSSH2_SESS
* or less (including length, padding length, payload,
* padding, and MAC.)."
*/
- if (total_num > LIBSSH2_PACKET_MAXPAYLOAD) {
+ if (total_num > LIBSSH2_PACKET_MAXPAYLOAD || total_num == 0) {
return LIBSSH2_ERROR_OUT_OF_BOUNDARY;
}