From: Dave Hart Date: Fri, 5 Feb 2010 22:26:34 +0000 (+0000) Subject: [Bug 1480] snprintf() cleanup caused unterminated refclock IDs. X-Git-Tag: NTP_4_2_7P18~2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f4ebc45f4a5d55b39ad0bb51e8978cb28f3c605;p=thirdparty%2Fntp.git [Bug 1480] snprintf() cleanup caused unterminated refclock IDs. bk: 4b6c9b1aL1VU1NGkwHzg7NDZle4SDA --- diff --git a/ChangeLog b/ChangeLog index f0d935e6d..b6e8ac6ef 100644 --- 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 diff --git a/ntpd/ntp_control.c b/ntpd/ntp_control.c index d87b5afbf..eb3fe440e 100644 --- a/ntpd/ntp_control.c +++ b/ntpd/ntp_control.c @@ -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); }