From 8ce9a66ccf67c4414b865cc91004e98006f0625e Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 9 Jan 2011 00:34:09 +0100 Subject: [PATCH] sftp_packet_read: use 32bit variables for 32bit data --- src/sftp.c | 3 ++- src/sftp.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sftp.c b/src/sftp.c index e1c4f9a..f6138e3 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 cf75701..99636fa 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 */