From: Samuel Just Date: Fri, 11 Jan 2013 18:44:04 +0000 (-0800) Subject: OSD: check for empty command in do_command X-Git-Tag: v0.57~220 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8cf79f252a1bcea5713065390180a36f31d66dfd;p=ceph.git OSD: check for empty command in do_command Fixes: #3878 Signed-off-by: Samuel Just Reviewed-by: David Zafman --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index d0236e064194..a0bcecabf9ed 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -2874,9 +2874,12 @@ void OSD::do_command(Connection *con, tid_t tid, vector& 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") {