Bug#45611: Minor code cleanup
Remove a self assignment. Rework a few constructs to avoid a potential overflow. Based upon patch contributed by Michal Hrusecky storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp: Remove self assignment, the object is being initialized. storage/ndb/src/mgmsrv/InitConfigFileParser.cpp: Setup the string in a single snprintf.
This commit is contained in:
parent
6bc9610022
commit
8c7c09cc63
@ -7521,8 +7521,8 @@ void Dbdict::execGET_TABINFOREQ(Signal* signal)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
releaseSections(signal);
|
releaseSections(signal);
|
||||||
|
|
||||||
DictObject * old_ptr_p = old_ptr_p = get_object(tableName, len);
|
DictObject * old_ptr_p = get_object(tableName, len);
|
||||||
if(old_ptr_p)
|
if(old_ptr_p)
|
||||||
obj_id = old_ptr_p->m_id;
|
obj_id = old_ptr_p->m_id;
|
||||||
} else {
|
} else {
|
||||||
|
@ -208,11 +208,10 @@ InitConfigFileParser::run_config_rules(Context& ctx)
|
|||||||
ctx.m_config->put("NoOfNodes", nNodes);
|
ctx.m_config->put("NoOfNodes", nNodes);
|
||||||
|
|
||||||
char tmpLine[MAX_LINE_LENGTH];
|
char tmpLine[MAX_LINE_LENGTH];
|
||||||
BaseString::snprintf(tmpLine, MAX_LINE_LENGTH, "EXTERNAL SYSTEM_");
|
BaseString::snprintf(tmpLine, MAX_LINE_LENGTH,
|
||||||
strncat(tmpLine, system, MAX_LINE_LENGTH);
|
"EXTERNAL SYSTEM_%s:NoOfConnections", system);
|
||||||
strncat(tmpLine, ":NoOfConnections", MAX_LINE_LENGTH);
|
|
||||||
ctx.m_config->put(tmpLine, nExtConnections);
|
ctx.m_config->put(tmpLine, nExtConnections);
|
||||||
|
|
||||||
Config * ret = new Config();
|
Config * ret = new Config();
|
||||||
ret->m_configValues = (struct ndb_mgm_configuration*)ctx.m_configValues.getConfigValues();
|
ret->m_configValues = (struct ndb_mgm_configuration*)ctx.m_configValues.getConfigValues();
|
||||||
ret->m_oldConfig = ctx.m_config; ctx.m_config = 0;
|
ret->m_oldConfig = ctx.m_config; ctx.m_config = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user