Commit eb772e22 authored by unknown's avatar unknown

Bug #13611 double [TCP DEFAULT] in config.ini crashes ndb_mgmd

- Added error printout and nice exit for duplicate default sections

parent a53386aa
...@@ -565,8 +565,12 @@ InitConfigFileParser::storeSection(Context& ctx){ ...@@ -565,8 +565,12 @@ InitConfigFileParser::storeSection(Context& ctx){
} }
} }
} }
if(ctx.type == InitConfigFileParser::DefaultSection) if(ctx.type == InitConfigFileParser::DefaultSection &&
require(ctx.m_defaults->put(ctx.pname, ctx.m_currentSection)); !ctx.m_defaults->put(ctx.pname, ctx.m_currentSection))
{
ctx.reportError("Duplicate default section not allowed");
return false;
}
if(ctx.type == InitConfigFileParser::Section) if(ctx.type == InitConfigFileParser::Section)
require(ctx.m_config->put(ctx.pname, ctx.m_currentSection)); require(ctx.m_config->put(ctx.pname, ctx.m_currentSection));
delete ctx.m_currentSection; ctx.m_currentSection = NULL; delete ctx.m_currentSection; ctx.m_currentSection = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment