diff --git a/src/conf.c b/src/conf.c index 938f1c6b..8c8e57b9 100644 --- a/src/conf.c +++ b/src/conf.c @@ -815,7 +815,13 @@ static void conf_cb(uev_t *w, void *arg, int events) for (off = 0; off < sz; off += sizeof(*ev) + ev->len) { struct iwatch_path *iwp; + if (off + sizeof(*ev) >= sizeof(ev_buf)) + break; + ev = (struct inotify_event *)&ev_buf[off]; + if (off + sizeof(*ev) + ev->len >= sizeof(ev_buf)) + break; + if (!ev->mask) continue;