X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/038ec85e825fc940c1387f64a88ae73b75f6822b..8d90b8b27bf086da6245030459ab3e5977313eb0:/sshdss.c diff --git a/sshdss.c b/sshdss.c index 532c13f2..6487d75a 100644 --- a/sshdss.c +++ b/sshdss.c @@ -72,6 +72,9 @@ static Bignum get160(char **data, int *datalen) { Bignum b; + if (*datalen < 20) + return NULL; + b = bignum_from_bytes((unsigned char *)*data, 20); *data += 20; *datalen -= 20; @@ -430,11 +433,11 @@ static void *dss_openssh_createkey(unsigned char **blob, int *len) dss->x = getmp(b, len); if (!dss->p || !dss->q || !dss->g || !dss->y || !dss->x) { - sfree(dss->p); - sfree(dss->q); - sfree(dss->g); - sfree(dss->y); - sfree(dss->x); + freebn(dss->p); + freebn(dss->q); + freebn(dss->g); + freebn(dss->y); + freebn(dss->x); sfree(dss); return NULL; }