diff -up ntp-4.2.6p5/ntpd/ntp_parser.y.cve-2015-7703 ntp-4.2.6p5/ntpd/ntp_parser.y --- ntp-4.2.6p5/ntpd/ntp_parser.y.cve-2015-7703 2015-08-20 12:21:43.206525550 +0200 +++ ntp-4.2.6p5/ntpd/ntp_parser.y 2015-08-20 12:31:04.223172507 +0200 @@ -1005,23 +1005,43 @@ misc_cmd_int_keyword misc_cmd_str_keyword : T_Leapfile - | T_Pidfile | T_Qos ; misc_cmd_str_lcl_keyword : T_Logfile + | T_Pidfile | T_Saveconfigdir ; drift_parm : T_String - { enqueue(cfgt.vars, create_attr_sval(T_Driftfile, $1)); } + { + if (input_from_file) { + enqueue(cfgt.vars, create_attr_sval(T_Driftfile, $1)); + } else { + YYFREE($1); + yyerror("driftfile remote configuration ignored"); + } + } | T_String T_Double - { enqueue(cfgt.vars, create_attr_dval(T_WanderThreshold, $2)); - enqueue(cfgt.vars, create_attr_sval(T_Driftfile, $1)); } + { + if (input_from_file) { + enqueue(cfgt.vars, create_attr_dval(T_WanderThreshold, $2)); + enqueue(cfgt.vars, create_attr_sval(T_Driftfile, $1)); + } else { + YYFREE($1); + yyerror("driftfile remote configuration ignored"); + } + } | /* Null driftfile, indicated by null string "\0" */ - { enqueue(cfgt.vars, create_attr_sval(T_Driftfile, "\0")); } + { + if (input_from_file) { + enqueue(cfgt.vars, create_attr_sval(T_Driftfile, estrdup(""))); + } else { + yyerror("driftfile remote configuration ignored"); + } + } ; variable_assign