X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/cf77c10b4214162ca8f4078b4ace728020d14cab..56668e6dca80813a2c9f03d4c02ed20e22f1061b:/import.c diff --git a/import.c b/import.c index bb863d77..ce957bc4 100644 --- a/import.c +++ b/import.c @@ -290,7 +290,7 @@ static int ssh2_read_mpint(void *data, int len, struct mpint_pos *ret) if (len < 4) goto error; bytes = GET_32BIT(d); - if (len < 4+bytes) + if (bytes < 0 || len-4 < bytes) goto error; ret->start = d + 4;