From cbeb1f4510c7806c1696cff05950fda12c4cc88c Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Sat, 7 Dec 2013 00:31:54 +0100 Subject: [PATCH] crush: detach_bucket must test item >= 0 not > 0 Since detach_bucket is a private helper solely used by move_bucket which contains another ( correct ) safeguard, the code cannot be reached and the problem can never happen. If another function uses detach_bucket, it may happen. Signed-off-by: Loic Dachary --- src/crush/CrushWrapper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crush/CrushWrapper.h b/src/crush/CrushWrapper.h index 9f5cbdfd3a6..c9bb37c9344 100644 --- a/src/crush/CrushWrapper.h +++ b/src/crush/CrushWrapper.h @@ -620,7 +620,7 @@ private: if (!crush) return (-EINVAL); - if (item > 0) + if (item >= 0) return (-EINVAL); // check that the bucket that we want to detach exists -- 2.47.3