diff options
author | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2009-09-01 09:32:26 -0300 |
---|---|---|
committer | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2009-09-01 09:32:26 -0300 |
commit | 004427a9bb80fd949b931bf14665e7d4f51c387e (patch) | |
tree | 4f7dec255cbbfbbb3e57433dc3cd54fe840d7653 | |
parent | a88c86f67f57fe19d4018717822bece5f4e50cfc (diff) | |
download | mariadb-git-004427a9bb80fd949b931bf14665e7d4f51c387e.tar.gz |
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
-rw-r--r-- | storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp | 4 | ||||
-rw-r--r-- | storage/ndb/src/mgmsrv/InitConfigFileParser.cpp | 7 |
2 files changed, 5 insertions, 6 deletions
diff --git a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp index a61a5bc035c..8f8d4aad9ab 100644 --- a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp +++ b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp @@ -7521,8 +7521,8 @@ void Dbdict::execGET_TABINFOREQ(Signal* signal) return; } 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 { diff --git a/storage/ndb/src/mgmsrv/InitConfigFileParser.cpp b/storage/ndb/src/mgmsrv/InitConfigFileParser.cpp index 569cb1eb654..560a9559999 100644 --- a/storage/ndb/src/mgmsrv/InitConfigFileParser.cpp +++ b/storage/ndb/src/mgmsrv/InitConfigFileParser.cpp @@ -208,11 +208,10 @@ 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(); ret->m_configValues = (struct ndb_mgm_configuration*)ctx.m_configValues.getConfigValues(); ret->m_oldConfig = ctx.m_config; ctx.m_config = 0; |