diff --git a/src/sftp.c b/src/sftp.c index e1c4f9a1..f6138e39 100644 --- a/src/sftp.c +++ b/src/sftp.c @@ -168,8 +168,9 @@ sftp_packet_read(LIBSSH2_SFTP *sftp) LIBSSH2_CHANNEL *channel = sftp->channel; LIBSSH2_SESSION *session = channel->session; unsigned char *packet; - size_t packet_len, packet_received; + size_t packet_received; ssize_t rc; + uint32_t packet_len; /* 32bits on the wire */ _libssh2_debug(session, LIBSSH2_TRACE_SFTP, "recv packet"); diff --git a/src/sftp.h b/src/sftp.h index cf757017..99636fa9 100644 --- a/src/sftp.h +++ b/src/sftp.h @@ -145,7 +145,7 @@ struct _LIBSSH2_SFTP unsigned char partial_size[4]; /* buffer for size field */ size_t partial_size_len; /* size field length */ unsigned char *partial_packet; /* The data */ - size_t partial_len; /* Desired number of bytes */ + uint32_t partial_len; /* Desired number of bytes */ size_t partial_received; /* Bytes received so far */ /* Time that libssh2_sftp_packet_requirev() started reading */