mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-16 11:20:58 -04:00
[master] check addrlen/scopelen fit within family address length
This commit is contained in:
parent
1330ae5fc2
commit
0302fcbf7e
1 changed files with 7 additions and 3 deletions
|
|
@ -3260,11 +3260,15 @@ render_ecs(isc_buffer_t *ecsbuf, isc_buffer_t *target) {
|
|||
for (i = 0; i < addrbytes; i ++)
|
||||
addr[i] = isc_buffer_getuint8(ecsbuf);
|
||||
|
||||
if (family == 1)
|
||||
if (family == 1) {
|
||||
if (addrlen > 32 || scopelen > 32)
|
||||
return (DNS_R_OPTERR);
|
||||
inet_ntop(AF_INET, addr, addr_text, sizeof(addr_text));
|
||||
else if (family == 2)
|
||||
} else if (family == 2) {
|
||||
if (addrlen > 128 || scopelen > 128)
|
||||
return (DNS_R_OPTERR);
|
||||
inet_ntop(AF_INET6, addr, addr_text, sizeof(addr_text));
|
||||
else {
|
||||
} else {
|
||||
snprintf(addr_text, sizeof(addr_text),
|
||||
"Unsupported family %u", family);
|
||||
ADD_STRING(target, addr_text);
|
||||
|
|
|
|||
Loading…
Reference in a new issue