summaryrefslogtreecommitdiffstats
path: root/contrib/ntp/libntp/decodenetnum.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ntp/libntp/decodenetnum.c')
-rw-r--r--contrib/ntp/libntp/decodenetnum.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/contrib/ntp/libntp/decodenetnum.c b/contrib/ntp/libntp/decodenetnum.c
index 187d5ca..35b908f 100644
--- a/contrib/ntp/libntp/decodenetnum.c
+++ b/contrib/ntp/libntp/decodenetnum.c
@@ -35,8 +35,11 @@ decodenetnum(
char *np;
char name[80];
- NTP_REQUIRE(num != NULL);
- NTP_REQUIRE(strlen(num) < sizeof(name));
+ REQUIRE(num != NULL);
+
+ if (strlen(num) >= sizeof(name)) {
+ return 0;
+ }
port_str = NULL;
if ('[' != num[0]) {
@@ -72,7 +75,7 @@ decodenetnum(
err = getaddrinfo(cp, "ntp", &hints, &ai);
if (err != 0)
return 0;
- NTP_INSIST(ai->ai_addrlen <= sizeof(*netnum));
+ INSIST(ai->ai_addrlen <= sizeof(*netnum));
ZERO(*netnum);
memcpy(netnum, ai->ai_addr, ai->ai_addrlen);
freeaddrinfo(ai);
OpenPOWER on IntegriCloud