X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/a03c9f9c9d2b4961fc334bebecf8f404a811ef28..c4c04facf82078b66673e1dfc607ee27f1adc490:/ssh.c diff --git a/ssh.c b/ssh.c index 174efe91..9661e2af 100644 --- a/ssh.c +++ b/ssh.c @@ -6418,9 +6418,10 @@ static void do_ssh2_authconn(Ssh ssh, unsigned char *in, int inlen, int ispkt) #define CHECK_HYPOTHESIS(offset, result) \ do { \ long q = offset; \ - if (q+4 <= len) { \ + if (q >= 0 && q+4 <= len) { \ q = q + 4 + GET_32BIT(p+q); \ - if (q+4 <= len && (q = q + 4 + GET_32BIT(p+q)) && q == len) \ + if (q >= 0 && q+4 <= len && \ + (q = q + 4 + GET_32BIT(p+q)) && q == len) \ result = TRUE; \ } \ } while(0)