Files
macports-ports/net/dnsmasq/files/0000-underflow.diff
T
Harry N 3d1fedf0aa dnsmasq: update to 2.92
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
2026-03-20 08:52:24 -04:00

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;