aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2018-10-01 20:58:47 +0200
committerAndreas Schneider <asn@cryptomilk.org>2018-10-19 22:01:28 +0200
commitbba2b02f280daa73e37764b0abb3e4ee11680e85 (patch)
tree19d9e12947014f573e71b22dff3c60bf6168c633
parent51b5bb4fc1d0dabf6ece82ef5b0205acb895c298 (diff)
downloadlibssh-bba2b02f280daa73e37764b0abb3e4ee11680e85.tar.gz
libssh-bba2b02f280daa73e37764b0abb3e4ee11680e85.tar.xz
libssh-bba2b02f280daa73e37764b0abb3e4ee11680e85.zip
buffer: Fix size comparison with count
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r--src/buffer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/buffer.c b/src/buffer.c
index da6e587f..b029f202 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -816,8 +816,8 @@ static int ssh_buffer_pack_allocate_va(struct ssh_buffer_struct *buffer,
ssh_string string = NULL;
char *cstring = NULL;
size_t needed_size = 0;
- size_t count;
size_t len;
+ int count; /* int for size comparison with argc */
int rc = SSH_OK;
for (p = format, count = 0; *p != '\0'; p++, count++) {
@@ -934,7 +934,7 @@ int ssh_buffer_pack_va(struct ssh_buffer_struct *buffer,
char *cstring;
bignum b;
size_t len;
- int count;
+ int count; /* int for size comparison with argc */
for (p = format, count = 0; *p != '\0'; p++, count++) {
/* Invalid number of arguments passed */
@@ -1098,7 +1098,7 @@ int ssh_buffer_unpack_va(struct ssh_buffer_struct *buffer,
} o;
size_t len, rlen, max_len;
va_list ap_copy;
- int count;
+ int count; /* int for size comparison with argc */
max_len = ssh_buffer_get_len(buffer);