From: Sage Weil Date: Fri, 9 Jul 2010 20:14:25 +0000 (-0700) Subject: mon: avoid OOB m->cmd access in auth proprocess_command X-Git-Tag: v0.21~134 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=878a7de521dcb83a56d09f259d2b5bb61a12b36b;p=ceph.git mon: avoid OOB m->cmd access in auth proprocess_command Signed-off-by: Sage Weil --- diff --git a/src/mon/AuthMonitor.cc b/src/mon/AuthMonitor.cc index f67424a4d632..5defe7b84374 100644 --- a/src/mon/AuthMonitor.cc +++ b/src/mon/AuthMonitor.cc @@ -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 {