]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MDSMonitor: handle invalid input for "ceph mds setmap"
authorYan, Zheng <zyan@redhat.com>
Mon, 18 Jan 2016 06:25:54 +0000 (14:25 +0800)
committerYan, Zheng <zyan@redhat.com>
Mon, 18 Jan 2016 06:25:54 +0000 (14:25 +0800)
Fixes: #14380
Signed-off-by: Yan, Zheng <zyan@redhat.com>
src/mon/MDSMonitor.cc

index 664af7b03e752aa87d2a7686db944274e1da75ce..c0fad8e074897fce8a32c70a5fa23e19051d494f 100644 (file)
@@ -1568,7 +1568,12 @@ int MDSMonitor::filesystem_command(
     r = 0;
   } else if (prefix == "mds setmap") {
     MDSMap map;
-    map.decode(m->get_data());
+    try {
+      map.decode(m->get_data());
+    } catch(buffer::error &e) {
+      ss << "invalid mdsmap";
+      return -EINVAL;
+    }
     epoch_t e = 0;
     int64_t epochnum;
     if (cmd_getval(g_ceph_context, cmdmap, "epoch", epochnum))