]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Bug #710 Fix new off-by-one error
authorDanny Mayer <mayer@ntp.org>
Mon, 18 Sep 2006 20:23:45 +0000 (16:23 -0400)
committerDanny Mayer <mayer@ntp.org>
Mon, 18 Sep 2006 20:23:45 +0000 (16:23 -0400)
bk: 450f0051TER0zZr1Zn1gAn8IdishQw

libntp/ntp_rfc2553.c

index a3b3f2801e1ed8a589462dafd4f19e536539a0e3..b5e0ecacc9646bdedbcfe06476b8fd71b1aa804e 100644 (file)
@@ -308,7 +308,7 @@ getnameinfo (const struct sockaddr *sa, u_int salen, char *host,
                namelen = min(strlen(hp->h_name), hostlen - 1);
                if (namelen > 0) {
                        strncpy(host, hp->h_name, namelen);
-                       host[namelen - 1] = '\0';
+                       host[namelen] = '\0';
                }
        }
        return (0);