summaryrefslogtreecommitdiff
path: root/storage/ndb
diff options
context:
space:
mode:
authorunknown <lzhou/zhl@dev3-63.(none)>2007-04-26 14:10:31 +0000
committerunknown <lzhou/zhl@dev3-63.(none)>2007-04-26 14:10:31 +0000
commitd4e79afb60d650b8a7a120c9dbb4da08a3509f80 (patch)
treea24e5550fa7c0fb533ca07fdcc530e38306a23d8 /storage/ndb
parent4bf990241421a7ca10741be1b9cb8cc2fd77995e (diff)
parentffe14d872e12dc589ac7dd8a1cbf7cd698ab57ff (diff)
downloadmariadb-git-d4e79afb60d650b8a7a120c9dbb4da08a3509f80.tar.gz
Merge lzhou@bk-internal.mysql.com:/home/bk/mysql-5.1-new-ndb-bj
into dev3-63.(none):/home/zhl/mysql/mysql-5.1/bug27207 storage/ndb/src/mgmsrv/ConfigInfo.cpp: Auto merged
Diffstat (limited to 'storage/ndb')
-rw-r--r--storage/ndb/src/mgmsrv/ConfigInfo.cpp33
1 files changed, 29 insertions, 4 deletions
diff --git a/storage/ndb/src/mgmsrv/ConfigInfo.cpp b/storage/ndb/src/mgmsrv/ConfigInfo.cpp
index 05abe4ced9e..bca0c3fe700 100644
--- a/storage/ndb/src/mgmsrv/ConfigInfo.cpp
+++ b/storage/ndb/src/mgmsrv/ConfigInfo.cpp
@@ -2889,25 +2889,50 @@ static bool fixNodeId(InitConfigFileParser::Context & ctx, const char * data)
char buf[] = "NodeIdX"; buf[6] = data[sizeof("NodeI")];
char sysbuf[] = "SystemX"; sysbuf[6] = data[sizeof("NodeI")];
const char* nodeId;
- require(ctx.m_currentSection->get(buf, &nodeId));
+ if(!ctx.m_currentSection->get(buf, &nodeId))
+ {
+ ctx.reportError("Mandatory parameter %s missing from section"
+ "[%s] starting at line: %d",
+ buf, ctx.fname, ctx.m_sectionLineno);
+ return false;
+ }
char tmpLine[MAX_LINE_LENGTH];
strncpy(tmpLine, nodeId, MAX_LINE_LENGTH);
char* token1 = strtok(tmpLine, ".");
char* token2 = strtok(NULL, ".");
Uint32 id;
-
+
+ if(!token1)
+ {
+ ctx.reportError("Value for mandatory parameter %s missing from section "
+ "[%s] starting at line: %d",
+ buf, ctx.fname, ctx.m_sectionLineno);
+ return false;
+ }
if (token2 == NULL) { // Only a number given
errno = 0;
char* p;
id = strtol(token1, &p, 10);
- if (errno != 0) warning("STRTOK1", nodeId);
+ if (errno != 0 || id <= 0x0 || id > MAX_NODES)
+ {
+ ctx.reportError("Illegal value for mandatory parameter %s from section "
+ "[%s] starting at line: %d",
+ buf, ctx.fname, ctx.m_sectionLineno);
+ return false;
+ }
require(ctx.m_currentSection->put(buf, id, true));
} else { // A pair given (e.g. "uppsala.32")
errno = 0;
char* p;
id = strtol(token2, &p, 10);
- if (errno != 0) warning("STRTOK2", nodeId);
+ if (errno != 0 || id <= 0x0 || id > MAX_NODES)
+ {
+ ctx.reportError("Illegal value for mandatory parameter %s from section "
+ "[%s] starting at line: %d",
+ buf, ctx.fname, ctx.m_sectionLineno);
+ return false;
+ }
require(ctx.m_currentSection->put(buf, id, true));
require(ctx.m_currentSection->put(sysbuf, token1));
}