Skip to content

Commit

Permalink
rbd: reject negative size (can make image that is hard to delete)
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Mick <dan.mick@inktank.com>
  • Loading branch information
Dan Mick committed Oct 17, 2012
1 parent 6f74e6b commit ee20cd0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/rbd.cc
Expand Up @@ -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;
Expand Down

0 comments on commit ee20cd0

Please sign in to comment.