1
0
mirror of https://github.com/anope/anope.git synced 2026-07-01 14:06:39 +02:00

Fix crashing when encountering an unterminated commented block.

This commit is contained in:
Sadie Powell
2023-02-06 17:10:29 +00:00
parent 33a337dfc0
commit dc1d9c837b
+6 -1
View File
@@ -943,5 +943,10 @@ void Conf::LoadConf(File &file)
if (!itemname.empty() || !wordbuffer.empty())
throw ConfigException("Unexpected garbage at end of file: " + file.GetName());
if (!block_stack.empty())
throw ConfigException("Unterminated block at end of file: " + file.GetName() + ". Block was opened on line " + stringify(block_stack.top()->linenum));
{
if (block_stack.top())
throw ConfigException("Unterminated block at end of file: " + file.GetName() + ". Block was opened on line " + stringify(block_stack.top()->linenum));
else
throw ConfigException("Unterminated commented block at end of file: " + file.GetName());
}
}