All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yongji Xie <xieyongji@bytedance.com>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	 Markus Armbruster <armbru@redhat.com>,
	qemu-block@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH 2/4] libvduse: Replace strcpy() with strncpy()
Date: Tue, 28 Jun 2022 10:59:40 +0800	[thread overview]
Message-ID: <CACycT3tBMFaNKx2Crgga9bVP3iriUFyErLbakxgY8oDn7i7W2Q@mail.gmail.com> (raw)
In-Reply-To: <c3190d64-447f-cf46-5dd8-f5e305c04b1e@linaro.org>

On Tue, Jun 28, 2022 at 8:26 AM Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> On 6/27/22 14:32, Xie Yongji wrote:
> > -    strcpy(dev_config->name, name);
> > +    strncpy(dev_config->name, name, VDUSE_NAME_MAX);
> > +    dev_config->name[VDUSE_NAME_MAX - 1] = '\0';
>
> g_strlcpy
>

Now we don't have a dependency on glib, so we use strncpy here.

Thanks,
Yongji


  reply	other threads:[~2022-06-28  3:02 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-27  9:01 [PATCH 0/4] Fix some coverity issues on VDUSE Xie Yongji
2022-06-27  9:02 ` [PATCH 1/4] libvduse: Fix the incorrect function name Xie Yongji
2022-06-29  9:37   ` Markus Armbruster
2022-06-27  9:02 ` [PATCH 2/4] libvduse: Replace strcpy() with strncpy() Xie Yongji
2022-06-28  0:25   ` Richard Henderson
2022-06-28  2:59     ` Yongji Xie [this message]
2022-06-29  9:38   ` Markus Armbruster
2022-06-27  9:02 ` [PATCH 3/4] libvduse: Pass positive value to strerror() Xie Yongji
2022-06-28  0:26   ` Richard Henderson
2022-06-29  9:38   ` Markus Armbruster
2022-06-27  9:02 ` [PATCH 4/4] libvduse: Check the return value of some ioctls Xie Yongji
2022-06-29  9:41   ` Markus Armbruster
2022-06-29 11:10     ` Yongji Xie
2022-06-29 11:39       ` Markus Armbruster
2022-06-29 12:37         ` Yongji Xie
2022-06-29 13:22           ` Markus Armbruster
2022-06-29 13:28             ` Yongji Xie

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=CACycT3tBMFaNKx2Crgga9bVP3iriUFyErLbakxgY8oDn7i7W2Q@mail.gmail.com \
    --to=xieyongji@bytedance.com \
    --cc=armbru@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=stefanha@redhat.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.