]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 1646] ntpd crashes with relative path to logfile.
authorDave Hart <hart@ntp.org>
Mon, 27 Sep 2010 18:06:28 +0000 (18:06 +0000)
committerDave Hart <hart@ntp.org>
Mon, 27 Sep 2010 18:06:28 +0000 (18:06 +0000)
bk: 4ca0dd24ppK3cHFn9cF2xQsI3nsF6A

ChangeLog
ntpd/ntpd.c

index d2f219af75d4594079fa99b254d777dc209d3a6d..cfb5a950329dbc578f8ab45737e0340712d5b85b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+* [Bug 1646] ntpd crashes with relative path to logfile.
 * Documentation updates from Dave Mills.
 (4.2.7p56) 2010/09/25 Released by Harlan Stenn <stenn@ntp.org>
 * Clock combining algorithm improvements from Dave Mills.
index 09c5fce37b255423de11ea0301ad7ad8b7e96523..b2fdeedbbe208c15236aca0c7f3bd7cc19389eb0 100644 (file)
@@ -370,15 +370,12 @@ change_logfile(
                                cd_octets--;
                        octets = cd_octets;
                        octets += 1;    /* separator '/' */
-                       octets += strlen(syslog_fname);
+                       octets += strlen(log_fname);
                        octets += 1;    /* NUL terminator */
                        abs_fname = emalloc(octets);
-                       /* It's strictly assumed that cd_octets fits into
-                        * an 'int' without overflow or sign change!
-                        */
                        snprintf(abs_fname, octets, "%.*s%c%s",
                                 (int)cd_octets, curdir, DIR_SEP,
-                                syslog_fname);
+                                log_fname);
                } else
 #endif
                        abs_fname = estrdup(log_fname);