From: Gunnar Beutner Date: Wed, 9 Oct 2013 06:56:28 +0000 (+0200) Subject: config: Make sure we're not inside a comment when reaching the end of a config file. X-Git-Tag: v0.0.3~224 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=78fa9bca095166663322e674d62bd86d72d45b33;p=icinga2 config: Make sure we're not inside a comment when reaching the end of a config file. Fixes #4821 --- diff --git a/lib/config/config_lexer.ll b/lib/config/config_lexer.ll index d2d95f437..6729d966e 100644 --- a/lib/config/config_lexer.ll +++ b/lib/config/config_lexer.ll @@ -183,6 +183,14 @@ static char *lb_steal(lex_buf *lb) "*" /* ignore star */ } +<> { + std::ostringstream msgbuf; + msgbuf << "End-of-file while in comment: " << yytext << " " << *yylloc; + ConfigCompilerContext::GetInstance()->AddMessage(true, msgbuf.str()); + yyterminate(); + } + + \/\/[^\n]* /* ignore C++-style comments */ [ \t\r\n] /* ignore whitespace */