]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 1480] snprintf() cleanup caused unterminated refclock IDs.
authorDave Hart <hart@ntp.org>
Fri, 5 Feb 2010 22:26:34 +0000 (22:26 +0000)
committerDave Hart <hart@ntp.org>
Fri, 5 Feb 2010 22:26:34 +0000 (22:26 +0000)
bk: 4b6c9b1aL1VU1NGkwHzg7NDZle4SDA

ChangeLog
ntpd/ntp_control.c

index f0d935e6d7111b2057610fe212f95f6d3706908b..b6e8ac6efb91f17cacb4be24e3345007b8d14d20 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 ---
 
 * [Bug 1477] 1st non-gmake make in clone w/VPATH can't make COPYRIGHT.
+* [Bug 1480] snprintf() cleanup caused unterminated refclock IDs.
 
 ---
 (4.2.6p1-RC4) 2010/02/04 Released by Harlan Stenn <stenn@ntp.org>
index d87b5afbf60181555a659de3a0a699ea21ae3cc4..eb3fe440e9666d54b68bb7195f444bc7e4ef2b46 100644 (file)
@@ -1275,7 +1275,7 @@ ctl_putid(
 
        *cp++ = '=';
        NTP_INSIST((cp - buffer) < sizeof(buffer));
-       snprintf(cp, sizeof(buffer) - (cp - buffer), "%s", id);
+       snprintf(cp, sizeof(buffer) - (cp - buffer), "%.4s", id);
        cp += strlen(cp);
        ctl_putdata(buffer, (unsigned)( cp - buffer ), 0);
 }