]> git.proxmox.com Git - mirror_qemu.git/commit
block/vdi: Don't take address of fields in packed structs
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 10 Dec 2018 11:26:48 +0000 (11:26 +0000)
committerKevin Wolf <kwolf@redhat.com>
Fri, 1 Feb 2019 12:46:44 +0000 (13:46 +0100)
commitac928b8ee875f1ac256702a2b93c8eb828ddaff2
treea52470eeb2b3263b6bc8fed05f6e0b28dbcabb97
parent0dbaaa7981e92a6b629b1cf0056dcafadd6ee8a5
block/vdi: Don't take address of fields in packed structs

Taking the address of a field in a packed struct is a bad idea, because
it might not be actually aligned enough for that pointer type (and
thus cause a crash on dereference on some host architectures). Newer
versions of clang warn about this.

Instead of passing UUID related functions the address of a possibly
unaligned QemuUUID struct, use local variables and then copy to/from
the struct field as appropriate.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/vdi.c