From: Dan Mick Date: Wed, 17 Oct 2012 01:22:35 +0000 (-0700) Subject: rbd: reject negative size (can make image that is hard to delete) X-Git-Tag: v0.55~271 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ee20cd02abd2b0c08f075e89f819eadfaccf7ee2;p=ceph.git rbd: reject negative size (can make image that is hard to delete) Signed-off-by: Dan Mick --- diff --git a/src/rbd.cc b/src/rbd.cc index ce638d99f787..76af1325e699 100644 --- a/src/rbd.cc +++ b/src/rbd.cc @@ -1330,6 +1330,10 @@ int main(int argc, const char **argv) cerr << "rbd: " << err.str() << std::endl; return EXIT_FAILURE; } + if (sizell < 0) { + cerr << "rbd: size must be > 0" << std::endl; + return EXIT_FAILURE; + } size = sizell << 20; // bytes to MB } else if (ceph_argparse_flag(args, i, "-l", "--long", (char*)NULL)) { lflag = true;