You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
dns_get_record(): A record with short RDATA publishes a wrong IP address (bytes taken from the next record) #25968
The first record must be rejected as malformed (RDLENGTH=1 cannot hold an IPv4 address),
i.e. only the second record should be returned (or the call should fail).
Root cause in php_parserr() (ext/standard/dns.c, master):
caseDNS_T_A:
CHECKCP(4); /* only guards the message end, not this record's RDATA */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);
CHECKCP(4) ensures the 4 bytes lie inside the received message, but nothing enforces dlen >= 4 for the record. With RDLENGTH = 1 the three missing bytes are read from the NEXT record's owner pointer / type field (c0 0c 00 → 192.12.0), producing the bogus address 9.192.12.0 returned to userland.
Activity