From e8f291f52b4de9242e776cd4832bcb8e2f5f8553 Mon Sep 17 00:00:00 2001 From: "tomas@poseidon.ndb.mysql.com" <> Date: Mon, 10 Oct 2005 12:27:48 +0200 Subject: [PATCH] Bug #13611 double [TCP DEFAULT] in config.ini crashes ndb_mgmd - Added error printout and nice exit for duplicate default sections --- ndb/src/mgmsrv/InitConfigFileParser.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ndb/src/mgmsrv/InitConfigFileParser.cpp b/ndb/src/mgmsrv/InitConfigFileParser.cpp index e0163b966c0..b2c290df9fc 100644 --- a/ndb/src/mgmsrv/InitConfigFileParser.cpp +++ b/ndb/src/mgmsrv/InitConfigFileParser.cpp @@ -558,8 +558,12 @@ InitConfigFileParser::storeSection(Context& ctx){ } } } - if(ctx.type == InitConfigFileParser::DefaultSection) - require(ctx.m_defaults->put(ctx.pname, ctx.m_currentSection)); + if(ctx.type == InitConfigFileParser::DefaultSection && + !ctx.m_defaults->put(ctx.pname, ctx.m_currentSection)) + { + ctx.reportError("Duplicate default section not allowed"); + return false; + } if(ctx.type == InitConfigFileParser::Section) require(ctx.m_config->put(ctx.pname, ctx.m_currentSection)); delete ctx.m_currentSection; ctx.m_currentSection = NULL;