Skip to content

Commit 2c21070

Browse files
committed
Fixed #8485: Segfault on incorrect databases.conf starting with subconfig
1 parent 80234ad commit 2c21070

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/common/config/config_file.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,12 @@ void ConfigFile::parse(Stream* stream)
692692
previous = &parameters[n];
693693
}
694694

695+
if (!previous)
696+
{
697+
badLine(streamName, "master parameter is missing before subconfig start '{'");
698+
return;
699+
}
700+
695701
{ // subconf scope
696702
SubStream subStream(stream->getFileName());
697703
int level = 1;
@@ -735,7 +741,7 @@ void ConfigFile::parse(Stream* stream)
735741
}
736742

737743
if (level > 0)
738-
badLine(streamName, "< missed closing bracket '}' >");
744+
badLine(streamName, "missed closing bracket '}'");
739745

740746
previous->sub = FB_NEW_POOL(getPool())
741747
ConfigFile(getPool(), &subStream, flags);

0 commit comments

Comments
 (0)