X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/dfb88efd1c9503370bee8e677bbefad6ef41df85..56668e6dca80813a2c9f03d4c02ed20e22f1061b:/sshdss.c diff --git a/sshdss.c b/sshdss.c index 6cf5830d..1f15cee9 100644 --- a/sshdss.c +++ b/sshdss.c @@ -43,6 +43,8 @@ static void getstring(char **data, int *datalen, char **p, int *length) if (*datalen < 4) return; *length = GET_32BIT(*data); + if (*length < 0) + return; *datalen -= 4; *data += 4; if (*datalen < *length) @@ -98,7 +100,7 @@ static void *dss_newkey(char *data, int len) } #endif - if (!p || memcmp(p, "ssh-dss", 7)) { + if (!p || slen != 7 || memcmp(p, "ssh-dss", 7)) { sfree(dss); return NULL; }