mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 18:28:25 +00:00
Handle failure of hash_questions()
This commit is contained in:
committed by
Simon Kelley
parent
fc2833f172
commit
b37f8b99ae
@@ -1417,6 +1417,7 @@ static int tcp_check_for_unsigned_zone(time_t now, struct dns_header *header, s
|
|||||||
|
|
||||||
/* We rely on the question section coming back unchanged, ensure it is with the hash. */
|
/* We rely on the question section coming back unchanged, ensure it is with the hash. */
|
||||||
if ((newhash = hash_questions(header, (unsigned int)m, name)))
|
if ((newhash = hash_questions(header, (unsigned int)m, name)))
|
||||||
|
{
|
||||||
memcpy(hash, newhash, HASH_SIZE);
|
memcpy(hash, newhash, HASH_SIZE);
|
||||||
|
|
||||||
*length = htons(m);
|
*length = htons(m);
|
||||||
@@ -1457,6 +1458,7 @@ static int tcp_check_for_unsigned_zone(time_t now, struct dns_header *header, s
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
free(packet);
|
free(packet);
|
||||||
|
|
||||||
@@ -1731,6 +1733,8 @@ unsigned char *tcp_request(int confd, time_t now,
|
|||||||
unsigned char *newhash, hash[HASH_SIZE];
|
unsigned char *newhash, hash[HASH_SIZE];
|
||||||
if ((newhash = hash_questions(header, (unsigned int)size, daemon->keyname)))
|
if ((newhash = hash_questions(header, (unsigned int)size, daemon->keyname)))
|
||||||
memcpy(hash, newhash, HASH_SIZE);
|
memcpy(hash, newhash, HASH_SIZE);
|
||||||
|
else
|
||||||
|
memset(hash, 0, HASH_SIZE);
|
||||||
#else
|
#else
|
||||||
unsigned int crc = questions_crc(header, (unsigned int)size, daemon->namebuff);
|
unsigned int crc = questions_crc(header, (unsigned int)size, daemon->namebuff);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user