Commit 30ab8873 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

check value of msg->get before using it


git-svn-id: svn://bind10.isc.org/svn/bind10/branches/f2f200910@274 e5f2f494-b856-4b98-b285-d166d9295462
parent ef3594c5
......@@ -54,14 +54,16 @@ CommandSession::getCommand() {
session_.group_recvmsg(routing, data, false);
cmd = data->get("command");
ep = cmd->get(0);
s = ep->string_value();
if (s == "addzone" || s == "delzone") {
return std::pair<string, string>(s, cmd->get(1)->string_value());
}
if (ep != NULL) {
return std::pair<string, string>(s, "");
if (cmd != NULL) {
ep = cmd->get(0);
if (ep != NULL) {
s = ep->string_value();
if (s == "addzone" || s == "delzone") {
return std::pair<string, string>(s,
cmd->get(1)->string_value());
}
return std::pair<string, string>(s, "");
}
}
return std::pair<string, string>("unknown", "");
......
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