From: Miroslav Lichvar Date: Wed, 10 Jun 2020 13:28:17 +0000 (+0200) Subject: conf: reset global pointers after parsing line X-Git-Tag: 4.0-pre3~88 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1d9a57bd0a3d4100abd59236daea1f962833caf;p=thirdparty%2Fchrony.git conf: reset global pointers after parsing line Don't leave dangling pointers in CNF_ParseLine(). --- diff --git a/conf.c b/conf.c index 2a4473d5..406829f4 100644 --- a/conf.c +++ b/conf.c @@ -491,8 +491,10 @@ CNF_ParseLine(const char *filename, int number, char *line) CPS_NormalizeLine(line); /* Skip blank lines */ - if (!*line) + if (!*line) { + processed_file = NULL; return; + } /* We have a real line, now try to match commands */ processed_command = command = line; @@ -673,6 +675,8 @@ CNF_ParseLine(const char *filename, int number, char *line) } else { other_parse_error("Invalid command"); } + + processed_file = processed_command = NULL; } /* ================================================== */