]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
OSD: check for empty command in do_command
authorSamuel Just <sam.just@inktank.com>
Fri, 11 Jan 2013 18:44:04 +0000 (10:44 -0800)
committerSamuel Just <sam.just@inktank.com>
Fri, 11 Jan 2013 20:15:53 +0000 (12:15 -0800)
Fixes: #3878
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: David Zafman <david.zafman@inktank.com>
src/osd/OSD.cc

index d0236e06419499b081e346f5deb26544fe088bb6..a0bcecabf9ed6026e93ba5ea2867045abddc7dc0 100644 (file)
@@ -2874,9 +2874,12 @@ void OSD::do_command(Connection *con, tid_t tid, vector<string>& cmd, bufferlist
 
   dout(20) << "do_command tid " << tid << " " << cmd << dendl;
 
-  if (cmd[0] == "version") {
+  if (cmd.size() == 0) {
+    ss << "no command given";
+    goto out;
+  }
+  else if (cmd[0] == "version") {
     ss << pretty_version_to_str();
-    r = 0;
     goto out;
   }
   else if (cmd[0] == "injectargs") {