Commit 8c7c09cc authored by Davi Arnaut's avatar Davi Arnaut

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.
parent 6bc96100
......@@ -7522,7 +7522,7 @@ void Dbdict::execGET_TABINFOREQ(Signal* 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)
obj_id = old_ptr_p->m_id;
} else {
......
......@@ -208,9 +208,8 @@ InitConfigFileParser::run_config_rules(Context& ctx)
ctx.m_config->put("NoOfNodes", nNodes);
char tmpLine[MAX_LINE_LENGTH];
BaseString::snprintf(tmpLine, MAX_LINE_LENGTH, "EXTERNAL SYSTEM_");
strncat(tmpLine, system, MAX_LINE_LENGTH);
strncat(tmpLine, ":NoOfConnections", MAX_LINE_LENGTH);
BaseString::snprintf(tmpLine, MAX_LINE_LENGTH,
"EXTERNAL SYSTEM_%s:NoOfConnections", system);
ctx.m_config->put(tmpLine, nExtConnections);
Config * ret = new Config();
......
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