qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Xu <peterx@redhat.com>, qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, kraxel@redhat.com
Subject: Re: [Qemu-devel] [PATCH] usb: fix unbound stack warning for inotify_watchfn
Date: Wed, 9 Mar 2016 08:56:26 +0100	[thread overview]
Message-ID: <56DFD72A.3080408@redhat.com> (raw)
In-Reply-To: <1457503640-31473-1-git-send-email-peterx@redhat.com>



On 09/03/2016 07:07, Peter Xu wrote:
> -    char buf[len];
> +    char buf[sizeof(struct inotify_event) + NAME_MAX + 1];
>  
>      for (;;) {
> -        bytes = read(s->inotifyfd, buf, len);
> +        bytes = read(s->inotifyfd, buf, sizeof(buf));

sizeof is good here, since read takes a size in bytes.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

  reply	other threads:[~2016-03-09  7:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-09  6:07 [Qemu-devel] [PATCH] usb: fix unbound stack warning for inotify_watchfn Peter Xu
2016-03-09  7:56 ` Paolo Bonzini [this message]
2016-03-18 12:56 ` Gerd Hoffmann

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=56DFD72A.3080408@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.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 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).