X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/aacc46fab3288bb9ac32c5d50ccfb9c3ecbfd95d..af1da2469967bdb6fcabd17750d1c5f88a3389d0:/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;