mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 10:18:25 +00:00
Protect against malicious DNS replies with very large RRsets.
This commit is contained in:
@@ -531,6 +531,11 @@ static int validate_rrset(time_t now, struct dns_header *header, size_t plen, in
|
||||
{
|
||||
unsigned char **new;
|
||||
|
||||
/* Protect against insane/maliciuos queries which bloat the workspace
|
||||
and eat CPU in the sort */
|
||||
if (rrsetidx >= 100)
|
||||
return STAT_INSECURE;
|
||||
|
||||
/* expand */
|
||||
if (!(new = whine_malloc((rrset_sz + 5) * sizeof(unsigned char **))))
|
||||
return STAT_INSECURE;
|
||||
|
||||
Reference in New Issue
Block a user