From 30b8d653751acb4bc4be5ca611f154e19afe910a Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 19 Feb 2013 08:29:53 -0800 Subject: [PATCH] mon: restrict pool size to 1..10 See: #4159 Signed-off-by: Sage Weil --- src/mon/OSDMonitor.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 9c094307e4cc6..0198c29e45b37 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -3013,6 +3013,11 @@ bool OSDMonitor::prepare_command(MMonCommand *m) unsigned n = strtol(start, &end, 10); if (*end == '\0') { if (m->cmd[4] == "size") { + if (n == 0 || n > 10) { + ss << "pool size must be between 1 and 10"; + err = -EINVAL; + goto out; + } if (pending_inc.new_pools.count(pool) == 0) pending_inc.new_pools[pool] = *p; pending_inc.new_pools[pool].size = n; -- 2.39.5