From: Harlan Stenn Date: Thu, 6 Feb 2003 01:08:26 +0000 (-0500) Subject: Terje found a short malloc. X-Git-Tag: NTP_4_1_74~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6397fe453fa595586a4d197fa5b931a2ebc6c013;p=thirdparty%2Fntp.git Terje found a short malloc. bk: 3e41b58axdfAup0a2VVQZ8mjOtrJFg --- diff --git a/libntp/ntp_rfc2553.c b/libntp/ntp_rfc2553.c index 313598070e..2f038e2a5b 100644 --- a/libntp/ntp_rfc2553.c +++ b/libntp/ntp_rfc2553.c @@ -251,7 +251,7 @@ do_nodename( ai->ai_addr->sa_len = sizeof(struct sockaddr); #endif if (hints != NULL && hints->ai_flags & AI_CANONNAME) { - ai->ai_canonname = malloc(strlen(hp->h_name)); + ai->ai_canonname = malloc(strlen(hp->h_name) + 1); if (ai->ai_canonname == NULL) return (EAI_MEMORY); strcpy(ai->ai_canonname, hp->h_name);