vmdk: check granularity field in opening
commit8aa1331c09a9b899f48d97f097bb49b7d458be1c
authorFam Zheng <famz@redhat.com>
Tue, 6 Aug 2013 07:44:51 +0000 (6 15:44 +0800)
committerKevin Wolf <kwolf@redhat.com>
Tue, 6 Aug 2013 13:27:32 +0000 (6 15:27 +0200)
treede7c81ae02697f839077c7f997030493d1fbd6f6
parentca6cbb657d66a7beb70f9d91848c80d1a72b1674
vmdk: check granularity field in opening

Granularity is used to calculate the cluster size and allocate r/w
buffer. Check the value from image before using it, so we don't abort()
for unbounded memory allocation.

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/vmdk.c
tests/qemu-iotests/059
tests/qemu-iotests/059.out