diff --git a/doh.c b/doh.c index 7fcab0b..1449f79 100644 --- a/doh.c +++ b/doh.c @@ -598,16 +598,13 @@ static DOHcode doh_decode(unsigned char *doh, if(rc) return rc; /* bad qname */ - if(dohlen < (index + 8)) + if(dohlen < (index + 10)) return DOH_DNS_OUT_OF_RANGE; index += 2; /* type */ index += 2; /* class */ index += 4; /* ttl */ - if(dohlen < (index + 2)) - return DOH_DNS_OUT_OF_RANGE; - rdlength = get16bit(doh, index); index += 2; if(dohlen < (index + rdlength)) @@ -622,7 +619,7 @@ static DOHcode doh_decode(unsigned char *doh, if(rc) return rc; /* bad qname */ - if(dohlen < (index + 8)) + if(dohlen < (index + 10)) return DOH_DNS_OUT_OF_RANGE; index += 2; /* type */