Skip to content

Commit

Permalink
Merge pull request #463 from libtom/pr/ssh-decode-encode-fix
Browse files Browse the repository at this point in the history
Avoid using LOAD32H/STORE32H with unsigned long
  • Loading branch information
karel-m committed Oct 29, 2018
2 parents 62cd873 + 09d116d commit f413335
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/misc/ssh/ssh_decode_sequence_multi.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ int ssh_decode_sequence_multi(const unsigned char *in, unsigned long inlen, ...)
char *sdata;
ulong32 *u32data;
ulong64 *u64data;
unsigned long size, bufsize;
unsigned long bufsize;
ulong32 size;

LTC_ARGCHK(in != NULL);

Expand All @@ -53,7 +54,7 @@ int ssh_decode_sequence_multi(const unsigned char *in, unsigned long inlen, ...)
}

/* Calculate (or read) length of data */
size = (unsigned long)-1;
size = 0xFFFFFFFFU;
switch (type) {
case LTC_SSHDATA_BYTE:
case LTC_SSHDATA_BOOLEAN:
Expand Down
2 changes: 1 addition & 1 deletion src/misc/ssh/ssh_encode_sequence_multi.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ int ssh_encode_sequence_multi(unsigned char *out, unsigned long *outlen, ...)
{
int err;
va_list args;
unsigned long size;
ulong32 size;
ssh_data_type type;
void *vdata;
const char *sdata;
Expand Down

0 comments on commit f413335

Please sign in to comment.