[ntpsec commit] Forward-port fix for [Bug 2883] ntpd crashes on exit with empty driftfile.

Eric S. Raymond esr at ntpsec.org
Fri Oct 23 02:59:40 UTC 2015


Module:    ntpsec
Branch:    master
Commit:    8391aff1bd330ed37a0b8013437f49e96b2f064f
Changeset: http://git.ntpsec.org/ntpsec/commit/?id=8391aff1bd330ed37a0b8013437f49e96b2f064f

Author:    Miroslav Lichvar <mlichvar at redhat.com>
Date:      Thu Oct 22 22:36:10 2015 -0400

Forward-port fix for [Bug 2883] ntpd crashes on exit with empty driftfile.

---

 NEWS              | 1 +
 ntpd/ntp_parser.y | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index 114ff5a..1a427f3 100644
--- a/NEWS
+++ b/NEWS
@@ -24,5 +24,6 @@ on user-visible changes.
 * [Bug 2860] ntpq ifstats sanity check is too stringent.  Frank Kardel.
 * [Bug 2866] segmentation fault at initgroups().  Harlan Stenn.
 * [Bug 2867] ntpd with autokey active crashed by 'ntpq -crv'
+* [Bug 2883] ntpd crashes on exit with empty driftfile.  Miroslav Lichvar.
 
 // end
diff --git a/ntpd/ntp_parser.y b/ntpd/ntp_parser.y
index 1622345..6c244da 100644
--- a/ntpd/ntp_parser.y
+++ b/ntpd/ntp_parser.y
@@ -1256,7 +1256,7 @@ drift_parm
 		{
 			attr_val *av;
 			
-			av = create_attr_sval(T_Driftfile, "");
+			av = create_attr_sval(T_Driftfile, estrdup(""));
 			APPEND_G_FIFO(cfgt.vars, av);
 		}
 	;



More information about the vc mailing list