]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Terje found a short malloc.
authorHarlan Stenn <stenn@ntp.org>
Thu, 6 Feb 2003 01:08:26 +0000 (20:08 -0500)
committerHarlan Stenn <stenn@ntp.org>
Thu, 6 Feb 2003 01:08:26 +0000 (20:08 -0500)
bk: 3e41b58axdfAup0a2VVQZ8mjOtrJFg

libntp/ntp_rfc2553.c

index 313598070e68cc896fd6fa4b22f9edd8ec4853a1..2f038e2a5bb1baf7b7494ab392c5cff0ddd9195c 100644 (file)
@@ -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);