mirror of
https://github.com/troglobit/finit.git
synced 2026-11-06 15:51:03 +00:00
Fix possible out-of-bounds read in inotify_event parser
Found by Coverity Scan. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
07a364e570
commit
6011f91f22
1 file changed
+6
@@ -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) {
|
for (off = 0; off < sz; off += sizeof(*ev) + ev->len) {
|
||||||
struct iwatch_path *iwp;
|
struct iwatch_path *iwp;
|
||||||
|
|
||||||
|
if (off + sizeof(*ev) >= sizeof(ev_buf))
|
||||||
|
break;
|
||||||
|
|
||||||
ev = (struct inotify_event *)&ev_buf[off];
|
ev = (struct inotify_event *)&ev_buf[off];
|
||||||
|
if (off + sizeof(*ev) + ev->len >= sizeof(ev_buf))
|
||||||
|
break;
|
||||||
|
|
||||||
if (!ev->mask)
|
if (!ev->mask)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user