]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virBitmapNewCopy: Honor sizes of either bitmap when doing memcpy()
authorPeter Krempa <pkrempa@redhat.com>
Thu, 17 Oct 2024 07:47:07 +0000 (09:47 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 17 Oct 2024 15:09:24 +0000 (17:09 +0200)
commitcfe638ef808c847164c0e70ce6b336b79be4debe
treea55ac091c617d9e08c663d038ce759f4dfcdfb96
parent99acc295578e69a3d526fc0ae063e981cd159ea0
virBitmapNewCopy: Honor sizes of either bitmap when doing memcpy()

'virBitmapNewCopy()' allocates a new bitmap with the same number of bits
but uses the internal allocation length as argument for the memcpy()
operation to copy the bits. Due to bugs in other code these may not be
the same resulting into a buffer overflow if the source is
over-allocated. Use the buffer length of the target bitmap instead.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
src/util/virbitmap.c