]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: avoid OOB m->cmd access in auth proprocess_command
authorSage Weil <sage@newdream.net>
Fri, 9 Jul 2010 20:14:25 +0000 (13:14 -0700)
committerSage Weil <sage@newdream.net>
Fri, 9 Jul 2010 20:14:25 +0000 (13:14 -0700)
Signed-off-by: Sage Weil <sage@newdream.net>
src/mon/AuthMonitor.cc

index f67424a4d632abb7c53b86bb833d861b45ef08dc..5defe7b843740d510c8a3037f52093c94b39cfda 100644 (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 {