X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;ds=sidebyside;f=sshrsa.c;h=6403343b247aac01aa7fd97675f67a687813064e;hb=896bb7c74d06200d92f846d666224e3f9c80b634;hp=0c1b2ef5a421d642a5fd57e26e26ad02a1902216;hpb=fa85085640c2b8cc45f6b6c015d19ee6b1dab0d5;p=PuTTY.git 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)