]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: blockPeek: Fix filling of the return buffer
authorPeter Krempa <pkrempa@redhat.com>
Mon, 18 Sep 2017 14:03:58 +0000 (16:03 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 19 Sep 2017 15:26:48 +0000 (17:26 +0200)
commitf767d53dbe484f33d71c173b3fa890515a91103b
tree0fdcf24521258c04d40e2c650e7e4f498c788f75
parenteb3fc2dd2a9ef8d2dc6198693aa8653d92b79b52
qemu: blockPeek: Fix filling of the return buffer

Commit 3956af495e broke the blockPeek API since virStorageFileRead
allocates a return buffer and fills it with the data, while the API
fills a user-provided buffer. This did not get caught by the compiler
since the API prototype uses a 'void *'.

Fix it by transferring the data from the allocated buffer to the user
provided buffer.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1491217
src/qemu/qemu_driver.c