[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] usb: fix unbound stack warning for inotify_watc
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH] usb: fix unbound stack warning for inotify_watchfn |
Date: |
Wed, 9 Mar 2016 08:56:26 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 |
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 <address@hidden>