Changeset View
Changeset View
Standalone View
Standalone View
head/contrib/ntp/lib/isc/netaddr.c
Show First 20 Lines • Show All 153 Lines • ▼ Show 20 Lines | |||||
#endif | #endif | ||||
default: | default: | ||||
return (ISC_R_FAILURE); | return (ISC_R_FAILURE); | ||||
} | } | ||||
r = inet_ntop(netaddr->family, type, abuf, sizeof(abuf)); | r = inet_ntop(netaddr->family, type, abuf, sizeof(abuf)); | ||||
if (r == NULL) | if (r == NULL) | ||||
return (ISC_R_FAILURE); | return (ISC_R_FAILURE); | ||||
alen = strlen(abuf); | alen = (unsigned int)strlen(abuf); /* no overflow possible */ | ||||
INSIST(alen < sizeof(abuf)); | INSIST(alen < sizeof(abuf)); | ||||
zlen = 0; | zlen = 0; | ||||
if (netaddr->family == AF_INET6 && netaddr->zone != 0) { | if (netaddr->family == AF_INET6 && netaddr->zone != 0) { | ||||
zlen = snprintf(zbuf, sizeof(zbuf), "%%%u", netaddr->zone); | zlen = snprintf(zbuf, sizeof(zbuf), "%%%u", netaddr->zone); | ||||
if (zlen < 0) | if (zlen < 0) | ||||
return (ISC_R_FAILURE); | return (ISC_R_FAILURE); | ||||
INSIST((unsigned int)zlen < sizeof(zbuf)); | INSIST((unsigned int)zlen < sizeof(zbuf)); | ||||
▲ Show 20 Lines • Show All 266 Lines • Show Last 20 Lines |