]> git.proxmox.com Git - mirror_qemu.git/commit
virtio: do not take address of packed members
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 26 Sep 2018 21:17:42 +0000 (23:17 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 2 Oct 2018 17:09:13 +0000 (19:09 +0200)
commitd41ca5afe3bc513ecf10b3ba5aa59523e3cd54aa
treebc22418e7e5070b59caa1679638f436b94b33b36
parentb255df7e6ee2b6da7a54b62b8e6c145054fec0db
virtio: do not take address of packed members

The address of a packed member is not packed, which may cause accesses
to unaligned pointers.  Avoid this by reading the packed value before
passing it to another function.

Cc: Jason Wang <jasowang@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/char/virtio-serial-bus.c