]> git.ipfire.org Git - thirdparty/qemu.git/commit
vmdk: Don't corrupt desc file in vmdk_write_cid
authorFam Zheng <fam@euphon.net>
Fri, 24 Nov 2023 11:56:54 +0000 (11:56 +0000)
committerMichael Tokarev <mjt@tls.msk.ru>
Wed, 20 Dec 2023 16:11:10 +0000 (19:11 +0300)
commitadfe37a19a8896e1736850f027312fb04559ec18
treebf3e9f8e7e93e426d741def7d1cc3e291b6d35bd
parent313f191150f23784d0464e54672fd7dfd2e3fc56
vmdk: Don't corrupt desc file in vmdk_write_cid

If the text description file is larger than DESC_SIZE, we force the last
byte in the buffer to be 0 and write it out.

This results in a corruption.

Try to allocate a big buffer in this case.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1923

Signed-off-by: Fam Zheng <fam@euphon.net>
Message-ID: <20231124115654.3239137-1-fam@euphon.net>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 9fb7b350ba9816ebca8a7614fec486fd4269ab2d)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
(Mjt: fixups in block/vmdk.c due to missing-in-7.2 v8.0.0-2084-g28944f99c4
 "vmdk: mark more functions as coroutine_fns and GRAPH_RDLOCK")
block/vmdk.c
tests/qemu-iotests/059
tests/qemu-iotests/059.out