Handle copying bitmaps to larger data buffers
Handle copying bitmaps to larger data buffers

If a bitmap of a shorter length than the data buffer is passed to
virBitmapToDataBuf, it will read off the end of the bitmap and copy junk
into the returned buffer. Add a check to only copy the length of the
bitmap to the buffer.

The problem can be observed after setting a vcpu affinity using the vcpupin
command on a system with a large number of cores:
  # virsh vcpupin example_domain 0 0
  # virsh vcpupin example_domain 0
     VCPU   CPU Affinity
    ---------------------------
     0      0,192,197-198,202

Signed-off-by: John Allen <7d56a0a8cc27bd7f80c310c7f28ba5782bacc86e@amd.com>

andreabolognani/libvirt,fabianfreyer/libvirt,jfehlig/libvirt,crobinso/libvirt,nertpinx/libvirt,libvirt/libvirt,andreabolognani/libvirt,eskultety/libvirt,fabianfreyer/libvirt,fabianfreyer/libvirt,eskultety/libvirt,olafhering/libvirt,jardasgit/libvirt,zippy2/libvirt,libvirt/libvirt,andreabolognani/libvirt,crobinso/libvirt,fabianfreyer/libvirt,eskultety/libvirt,fabianfreyer/libvirt,jfehlig/libvirt,crobinso/libvirt,andreabolognani/libvirt,nertpinx/libvirt,nertpinx/libvirt,nertpinx/libvirt,andreabolognani/libvirt,zippy2/libvirt,jardasgit/libvirt,jardasgit/libvirt,nertpinx/libvirt,olafhering/libvirt,libvirt/libvirt,jfehlig/libvirt,olafhering/libvirt,jfehlig/libvirt,zippy2/libvirt,olafhering/libvirt,eskultety/libvirt,crobinso/libvirt,jardasgit/libvirt,libvirt/libvirt,zippy2/libvirt,jardasgit/libvirt,eskultety/libvirt