]> git.tuebingen.mpg.de Git - dss.git/commit - dss.c
Reject insane number of intervals.
authorAndre Noll <maan@systemlinux.org>
Sun, 28 Oct 2012 19:11:16 +0000 (20:11 +0100)
committerAndre Noll <maan@systemlinux.org>
Sun, 28 Oct 2012 19:11:16 +0000 (20:11 +0100)
commit024b342374b97ce23ac35f4ff7da146f1088d94b
tree546db07402b013b114ab1748b36d82dbb82fadbf
parent6c76799c7334a12926dc1cf0c32670423cbc954f
Reject insane number of intervals.

Nobody needs more than 2^30 snapshots. More importantly, values
larger than 32 for --num_intervals cause an integer overflow in
desired_number_of_snapshots() because the number of snapshots in
interval zero does not fit in an unsigned int in this case.

This patch adds a test to check_config() that rejects values larger
than 30 for the --num_intervals option.

Many thanks to Klaus Kopec for pointing out this bug.
dss.c