mon: avoid OOB m->cmd access in auth proprocess_command

Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
Sage Weil 2010-07-09 13:14:25 -07:00
parent c91c8a3115
commit 878a7de521

View File

@ -496,10 +496,10 @@ bool AuthMonitor::preprocess_command(MMonCommand *m)
r = 0;
}
}
else if (m->cmd[1] == "get") {
else if (m->cmd[1] == "get" && m->cmd.size() > 2) {
KeyRing keyring;
EntityName entity;
if(!entity.from_str(m->cmd[2])) {
if (!entity.from_str(m->cmd[2])) {
ss << "failed to identify entity name from " << m->cmd[2];
r = -ENOENT;
} else {