mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 18:28: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;
|
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 */
|
/* expand */
|
||||||
if (!(new = whine_malloc((rrset_sz + 5) * sizeof(unsigned char **))))
|
if (!(new = whine_malloc((rrset_sz + 5) * sizeof(unsigned char **))))
|
||||||
return STAT_INSECURE;
|
return STAT_INSECURE;
|
||||||
|
|||||||
Reference in New Issue
Block a user