qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 2/3] smbios: fix uuid copy


From: Fam Zheng
Subject: [Qemu-devel] [PULL 2/3] smbios: fix uuid copy
Date: Sun, 2 Oct 2016 09:52:02 +0800

From: Marc-André Lureau <address@hidden>

Since 9c5ce8db, the uuid is wrongly copied, as QemuUUID 'in' argument is
already a pointer.

Fixes ASAN complaining:
hw/smbios/smbios.c:489:5: runtime error: load of address 0x7fffcdb91b00
with insufficient space for an object of type '__int128 unsigned'

Signed-off-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
[Warp the long error message line in commit message. - Fam]
Signed-off-by: Fam Zheng <address@hidden>
---
 hw/smbios/smbios.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c
index 9a6552a..3a96ced 100644
--- a/hw/smbios/smbios.c
+++ b/hw/smbios/smbios.c
@@ -486,7 +486,7 @@ static void smbios_build_type_0_table(void)
  */
 static void smbios_encode_uuid(struct smbios_uuid *uuid, QemuUUID *in)
 {
-    memcpy(uuid, &in, 16);
+    memcpy(uuid, in, 16);
     if (smbios_uuid_encoded) {
         uuid->time_low = bswap32(uuid->time_low);
         uuid->time_mid = bswap16(uuid->time_mid);
-- 
2.7.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]