From 79895282a8cde692831c1ffce868a963517812b1 Mon Sep 17 00:00:00 2001 From: lazerg Date: Tue, 1 Dec 2026 06:40:11 +0500 Subject: [PATCH] Fix GH-25968: dns_get_record() reads A record bytes past a short RDATA --- ext/standard/dns.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/standard/dns.c b/ext/standard/dns.c index 9028accb3fd5..67031f38ccba 100644 --- a/ext/standard/dns.c +++ b/ext/standard/dns.c @@ -500,7 +500,9 @@ static uint8_t *php_parserr(uint8_t *cp, uint8_t *end, querybuf *answer, int typ switch (type) { case DNS_T_A: - CHECKCP(4); + if (dlen < 4) { + goto fail; + } add_assoc_string(subarray, "type", "A"); snprintf(name, sizeof(name), "%d.%d.%d.%d", cp[0], cp[1], cp[2], cp[3]); add_assoc_string(subarray, "ip", name);