X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/d737853b942c17aeb9db09ef59046edd9daa652e..b165006759a81e8ecc4e86e0540fd69343ea46e9:/sshrsa.c diff --git a/sshrsa.c b/sshrsa.c index 0c1b2ef5..6403343b 100644 --- a/sshrsa.c +++ b/sshrsa.c @@ -110,7 +110,7 @@ static void sha512_mpint(SHA512_State * s, Bignum b) lenbuf[0] = bignum_byte(b, len); SHA512_Bytes(s, lenbuf, 1); } - memset(lenbuf, 0, sizeof(lenbuf)); + smemclr(lenbuf, sizeof(lenbuf)); } /* @@ -525,7 +525,9 @@ static void getstring(char **data, int *datalen, char **p, int *length) *p = NULL; if (*datalen < 4) return; - *length = GET_32BIT(*data); + *length = toint(GET_32BIT(*data)); + if (*length < 0) + return; *datalen -= 4; *data += 4; if (*datalen < *length)