You've already forked macports-ports
mirror of
https://github.com/macports/macports-ports.git
synced 2026-07-12 18:20:25 -07:00
3d1fedf0aa
I also added an underflow patch, but the attribution prevented the package from building. The patch source is https://src.fedoraproject.org/rpms/dnsmasq/raw/rawhide/f/dnsmasq-2.77-underflow.patch
14 lines
412 B
Diff
14 lines
412 B
Diff
--- src/rfc1035.c.orig
|
|
+++ src/rfc1035.c
|
|
@@ -1624,6 +1624,9 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
|
|
int rd_bit = (header->hb3 & HB3_RD);
|
|
int count = 255; /* catch loops */
|
|
|
|
+ // Make sure we do not underflow here too.
|
|
+ if ((ssize_t)qlen > (limit - ((char *)header))) return 0;
|
|
+
|
|
/* Suppress cached answers if no_cache set. */
|
|
if (no_cache)
|
|
rd_bit = 0;
|
|
|