From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Valentin David <valentin.david@gmail.com>
Cc: qemu-devel@nongnu.org, Ani Sinha <anisinha@redhat.com>,
Igor Mammedov <imammedo@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Valentin David <valentin.david@canonical.com>
Subject: Re: [PATCH] hw/smbios/smbios.c: Add missing NUL terminal to string from path= parameter
Date: Wed, 26 Mar 2025 16:47:18 +0000 [thread overview]
Message-ID: <Z-QvlvtsCErUo7_M@redhat.com> (raw)
In-Reply-To: <20250326155254.2273939-1-valentin.david@canonical.com>
On Wed, Mar 26, 2025 at 04:52:54PM +0100, Valentin David wrote:
> 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);
That is inside the loop body, so it is appending an extra '\0' after
every 'read'.
The fix for this issue is posted here
https://lists.nongnu.org/archive/html/qemu-devel/2025-03/msg05826.html
> }
>
> qemu_close(fd);
> --
> 2.48.1
>
>
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
prev parent reply other threads:[~2025-03-26 16:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z-QvlvtsCErUo7_M@redhat.com \
--to=berrange@redhat.com \
--cc=anisinha@redhat.com \
--cc=imammedo@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=valentin.david@canonical.com \
--cc=valentin.david@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.