]> git.proxmox.com Git - mirror_qemu.git/commit
vmdk: Check descriptor file length when reading it
authorFam Zheng <famz@redhat.com>
Wed, 3 Dec 2014 23:28:32 +0000 (07:28 +0800)
committerKevin Wolf <kwolf@redhat.com>
Wed, 10 Dec 2014 09:31:21 +0000 (10:31 +0100)
commit03c3359dfc490eaf922f88955d6a8cc51a37ce92
tree64bbd7d73f08dccbb1f5cc901543caa341fec9fa
parent73b7bcad439e0edaced05049897090cc10d84b5b
vmdk: Check descriptor file length when reading it

Since a too small file cannot be a valid VMDK image, and also since the
buffer's first 4 bytes will be unconditionally examined by
vmdk_open_sparse, let's error out the small file case to be clear.

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Don Koch <dkoch@verizon.com>
Message-id: 1417649314-13704-5-git-send-email-famz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/vmdk.c