From 57978f52fce339954d6d3a635939522aa4f6a5b1 Mon Sep 17 00:00:00 2001 From: "tomas@poseidon.ndb.mysql.com" <> Date: Mon, 10 Oct 2005 12:25:29 +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 94f07ab0ca1..f643349a493 100644 --- a/ndb/src/mgmsrv/InitConfigFileParser.cpp +++ b/ndb/src/mgmsrv/InitConfigFileParser.cpp @@ -565,8 +565,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;