1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-27 13:21:11 +03:00

sftp: Add missing size checks

CID 1238630

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Andreas Schneider
2018-08-06 09:19:45 +02:00
parent fbfe002460
commit 24aef4fbf1

View File

@@ -355,7 +355,7 @@ sftp_packet sftp_packet_read(sftp_session sftp) {
ssh_buffer_get_u8(packet->payload, &packet->type); ssh_buffer_get_u8(packet->payload, &packet->type);
size = ntohl(tmp); size = ntohl(tmp);
if (size == 0) { if (size == 0 || size > UINT32_MAX) {
return packet; return packet;
} }
size--; size--;