All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hw/smbios/smbios.c: Add missing NUL terminal to string from path= parameter
@ 2025-03-26 15:52 Valentin David
  2025-03-26 16:47 ` Daniel P. Berrangé
  0 siblings, 1 reply; 2+ messages in thread
From: Valentin David @ 2025-03-26 15:52 UTC (permalink / raw)
  To: qemu-devel; +Cc: Ani Sinha, Igor Mammedov, Michael S. Tsirkin, Valentin David

Without it, it seems the data gets garbage at the end of the string.

Signed-off-by: Valentin David <valentin.david@canonical.com>
---
 hw/smbios/smbios.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c
index 02a09eb9cd..7522e9a172 100644
--- a/hw/smbios/smbios.c
+++ b/hw/smbios/smbios.c
@@ -1283,6 +1283,7 @@ static int save_opt_one(void *opaque,
                 return -1;
             }
             g_byte_array_append(data, (guint8 *)buf, ret);
+            g_byte_array_append(data, (guint8 *)"\0", 1);
         }
 
         qemu_close(fd);
-- 
2.48.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-03-26 16:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-26 15:52 [PATCH] hw/smbios/smbios.c: Add missing NUL terminal to string from path= parameter Valentin David
2025-03-26 16:47 ` Daniel P. Berrangé

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.