From d2fbb50b988a7f2e21bb511c70652fdca9a544ca Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 4 Jun 2014 13:16:42 +1000 Subject: [PATCH] place a upper bound on rdcount --- lib/dns/master.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dns/master.c b/lib/dns/master.c index e6b1a0a803..a2eef3f2fd 100644 --- a/lib/dns/master.c +++ b/lib/dns/master.c @@ -2375,7 +2375,7 @@ load_raw(dns_loadctx_t *lctx) { rdatalist.covers = isc_buffer_getuint16(&target); rdatalist.ttl = isc_buffer_getuint32(&target); rdcount = isc_buffer_getuint32(&target); - if (rdcount == 0) { + if (rdcount == 0 || rdcount > 0xffff) { result = ISC_R_RANGE; goto cleanup; }