The parse clock driver of ntp-stable-4.2.0a-20050303 may write
messages containing unprintable characters to the ntpd logfile, as in
the following example:
9 Jan 17:03:03 ntpd[4882]: parse: convert_rawdcf: parity check FAILED for
"----------------A-MLS------4P1-4--2p-2--1--2-----11------8p"
The following patch fixes the problem by adding the buffer size to the
format string.
--- ntp-stable-4.2.0a-20050303/libparse/clk_rawdcf.c~ 2006-01-09
15:25:30.000000000 +0100
+++ ntp-stable-4.2.0a-20050303/libparse/clk_rawdcf.c 2006-01-10
15:31:46.000000000 +0100
@@ -207,7 +207,8 @@
register unsigned char *c = dcfprm->zerobits;
register int i;
- parseprintf(DD_RAWDCF,("parse: convert_rawdcf: \"%s\"\n", buffer));
+ parseprintf(DD_RAWDCF, ("parse: convert_rawdcf: \"%.*s\"\n",
+ size, buffer));
if (size < 57)
{
@@ -225,7 +226,9 @@
* we only have two types of bytes (ones and zeros)
*/
#ifndef PARSEKERNEL
- msyslog(LOG_ERR, "parse: convert_rawdcf: BAD DATA - no
conversion for \"%s\"\n", buffer);
+ msyslog(LOG_ERR, "parse: convert_rawdcf: "
+ "BAD DATA - no conversion for \"%.*s\"\n",
+ size, buffer);
#endif
return CVT_NONE;
}
@@ -298,7 +301,8 @@
* bad format - not for us
*/
#ifndef PARSEKERNEL
- msyslog(LOG_ERR, "parse: convert_rawdcf: parity check FAILED
for \"%s\"\n", buffer);
+ msyslog(LOG_ERR, "parse: convert_rawdcf: "
+ "parity check FAILED for \"%.*s\"\n", size, buffer);
#endif
return CVT_FAIL|CVT_BADFMT;
}
_______________________________________________
questions mailing list
[email protected]
https://lists.ntp.isc.org/mailman/listinfo/questions