Skip to content

Commit f413335

Browse files
authored
Merge pull request #463 from libtom/pr/ssh-decode-encode-fix
Avoid using LOAD32H/STORE32H with unsigned long
2 parents 62cd873 + 09d116d commit f413335

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/misc/ssh/ssh_decode_sequence_multi.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ int ssh_decode_sequence_multi(const unsigned char *in, unsigned long inlen, ...)
3333
char *sdata;
3434
ulong32 *u32data;
3535
ulong64 *u64data;
36-
unsigned long size, bufsize;
36+
unsigned long bufsize;
37+
ulong32 size;
3738

3839
LTC_ARGCHK(in != NULL);
3940

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

5556
/* Calculate (or read) length of data */
56-
size = (unsigned long)-1;
57+
size = 0xFFFFFFFFU;
5758
switch (type) {
5859
case LTC_SSHDATA_BYTE:
5960
case LTC_SSHDATA_BOOLEAN:

src/misc/ssh/ssh_encode_sequence_multi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ int ssh_encode_sequence_multi(unsigned char *out, unsigned long *outlen, ...)
2727
{
2828
int err;
2929
va_list args;
30-
unsigned long size;
30+
ulong32 size;
3131
ssh_data_type type;
3232
void *vdata;
3333
const char *sdata;

0 commit comments

Comments
 (0)