Skip to content

Commit 22fd998

Browse files
committed
Fixed #8485: Segfault on incorrect databases.conf starting with subconfig
1 parent 9832016 commit 22fd998

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/common/config/config_file.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,12 @@ void ConfigFile::parse(Stream* stream)
649649
previous = &parameters[n];
650650
}
651651

652+
if (!previous)
653+
{
654+
badLine(streamName, "master parameter is missing before subconfig start '{'");
655+
return;
656+
}
657+
652658
{ // subconf scope
653659
SubStream subStream(stream->getFileName());
654660
int level = 1;
@@ -692,7 +698,7 @@ void ConfigFile::parse(Stream* stream)
692698
}
693699

694700
if (level > 0)
695-
badLine(streamName, "< missed closing bracket '}' >");
701+
badLine(streamName, "missed closing bracket '}'");
696702

697703
previous->sub = FB_NEW_POOL(getPool())
698704
ConfigFile(getPool(), &subStream, flags);

0 commit comments

Comments
 (0)