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

(cherry picked from commit aa811801cb)
This commit is contained in:
Mark Andrews
2020-08-18 11:11:36 +02:00
committed by Ondřej Surý
parent 6aa46945ff
commit 8ed9da7324
+6 -2
View File
@@ -82,8 +82,12 @@ 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) {
goto done;
/*
* 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);
}
/*