2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 14:07:59 +00:00

dns_rdata_fromwire() only accepts input up to 2^16-1 octets.

This commit is contained in:
Mark Andrews
2020-08-15 08:50:37 +10:00
committed by Ondřej Surý
parent e4d30cb007
commit aa811801cb

View File

@@ -95,7 +95,11 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
unsigned int classes = (sizeof(classlist) / sizeof(classlist[0]));
unsigned int types = 1, flags, t;
if (size < 2) {
/*
* First 2 bytes are used to select type and class.
* dns_rdata_fromwire() only accepts input up to 2^16-1 octets.
*/
if (size < 2 || size > 0xffff + 2) {
return (0);
}