qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Shannon Zhao <zhaoshenglong@huawei.com>, qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, hangaohuai@huawei.com,
	qemu-trivial@nongnu.org, mjt@tls.msk.ru,
	peter.huangpeng@huawei.com, aneesh.kumar@linux.vnet.ibm.com,
	shannon.zhao@linaro.org
Subject: Re: [Qemu-devel] [PATCH] fsdev/virtfs-proxy-helper: Fix possible overflow
Date: Fri, 13 Mar 2015 13:51:01 +0100	[thread overview]
Message-ID: <5502DD35.60803@redhat.com> (raw)
In-Reply-To: <1426244997-11392-1-git-send-email-zhaoshenglong@huawei.com>



On 13/03/2015 12:09, Shannon Zhao wrote:
> +    g_assert(strlen(path) < sizeof(proxy.sun_path));
>      sock = socket(AF_UNIX, SOCK_STREAM, 0);
>      if (sock < 0) {
>          do_perror("socket");
> @@ -748,7 +749,7 @@ static int proxy_socket(const char *path, uid_t uid, gid_t gid)
>      umask(7);
>  
>      proxy.sun_family = AF_UNIX;
> -    strcpy(proxy.sun_path, path);
> +    strncpy(proxy.sun_path, path, sizeof(proxy.sun_path));
>      if (bind(sock, (struct sockaddr *)&proxy,

Same as the other patch.

Paolo

      reply	other threads:[~2015-03-13 12:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-13 11:09 [Qemu-devel] [PATCH] fsdev/virtfs-proxy-helper: Fix possible overflow Shannon Zhao
2015-03-13 12:51 ` Paolo Bonzini [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=5502DD35.60803@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=hangaohuai@huawei.com \
    --cc=mjt@tls.msk.ru \
    --cc=peter.huangpeng@huawei.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=shannon.zhao@linaro.org \
    --cc=zhaoshenglong@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).