raw_bsd: move check to prevent overflow
authorTomáš Golembiovský <tgolembi@redhat.com>
Thu, 3 Nov 2016 13:47:48 +0000 (14:47 +0100)
committerKevin Wolf <kwolf@redhat.com>
Fri, 11 Nov 2016 14:54:55 +0000 (15:54 +0100)
commit40332872fec584d2557ed2c3f48d55d15d95eddb
tree56c4fbddfd90ab3204da16d10acfcb3162cbaf52
parent11d6fbe05fd67610a7735e5350e4299f93bf7655
raw_bsd: move check to prevent overflow

When only offset is specified but no size and the offset is greater than
the real size of the containing device an overflow occurs when parsing
the options. This overflow is harmless because we do check for this
exact situation little bit later, but it leads to an error message with
weird values. It is better to do the check is sooner and prevent the
overflow.

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/raw_bsd.c