From: Anthony PERARD <anthony.perard@vates.tech>
To: Javi Merino <javi.merino@cloud.com>
Cc: xen-devel@lists.xenproject.org, Juergen Gross <jgross@suse.com>
Subject: Re: [XEN PATCH v3 2/3] libxl: Remove unnecessary buffer zeroing and zalloc()
Date: Tue, 03 Sep 2024 08:23:54 +0000 [thread overview]
Message-ID: <ZtbHmFPa2uoaEDt8@l14> (raw)
In-Reply-To: <f92d56a113c4b0472df2badb207a699d82deadaf.1725294334.git.javi.merino@cloud.com>
On Mon, Sep 02, 2024 at 05:38:38PM +0100, Javi Merino wrote:
> When reading the console, xen overwrites the contents of the buffer,
> so there is no need to zero the buffer before passing it to xen.
> Instead, add a NULL at the end of the buffer.
>
> While we are at it, change the zalloc() of the buffer back to
> malloc() as it was before bdf4131 (libxl: don't leak buf in
> libxl_xen_console_read_start error handling, 2013-12-03). The comment
> in that commit message says that the intent of the commit was to
> change malloc+memset to zalloc(), but only for the
> libxl_xen_console_reader struct, not for the buffer.
>
> Signed-off-by: Javi Merino <javi.merino@cloud.com>
Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
Thanks,
--
Anthony Perard | Vates XCP-ng Developer
XCP-ng & Xen Orchestra - Vates solutions
web: https://vates.tech
next prev parent reply other threads:[~2024-09-03 8:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-02 16:38 [XEN PATCH v3 0/3] libxl: Fixes for libxl_xenconsole_readline() Javi Merino
2024-09-02 16:38 ` [XEN PATCH v3 1/3] libxl: Fix nul-termination of the return value of libxl_xen_console_read_line() Javi Merino
2024-09-03 6:14 ` Jan Beulich
2024-09-02 16:38 ` [XEN PATCH v3 2/3] libxl: Remove unnecessary buffer zeroing and zalloc() Javi Merino
2024-09-03 8:23 ` Anthony PERARD [this message]
2024-09-02 16:38 ` [XEN PATCH v3 3/3] libxl: Update the documentation of libxl_xen_console_read_line() Javi Merino
2024-09-03 8:32 ` Anthony PERARD
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=ZtbHmFPa2uoaEDt8@l14 \
--to=anthony.perard@vates.tech \
--cc=javi.merino@cloud.com \
--cc=jgross@suse.com \
--cc=xen-devel@lists.xenproject.org \
/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.