]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virBitmapToString: Properly handle empty bitmaps
authorPeter Krempa <pkrempa@redhat.com>
Thu, 1 Oct 2020 12:13:37 +0000 (14:13 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 5 Oct 2020 10:26:22 +0000 (12:26 +0200)
commite2d13d607f23f6a219d50da2a9dfea5e934f4c95
treebee6c0133430c90ba4f330a81c67d4c57df187ca
parent2eada815b577e9811fc62f98bad6b31bde560421
virBitmapToString: Properly handle empty bitmaps

virBitmapNewEmpty() can create a bitmap with 0 length. With such a
bitmap virBitmapToString will return NULL rather than an empty string.
Initialize the buffer to avoid that.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/util/virbitmap.c