mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
inotify: Use memcmp() to compare embedded file names
Otherwise gcc warns that strcmp() will read a byte from a zero-length
array, though in practice we exclude that case with an explicit length
check.
Fixes: f1f230439f ("vfs: Initial revision of inotify")
This commit is contained in:
1 parent
4ea7a920de
commit
bc6b526e2b
1 file changed
+1
-1
@@ -503,7 +503,7 @@ inotify_can_coalesce(struct inotify_softc *sc, struct inotify_event *evp)
|
||||
return (prev != NULL && prev->ev.mask == evp->mask &&
|
||||
prev->ev.wd == evp->wd && prev->ev.cookie == evp->cookie &&
|
||||
prev->ev.len == evp->len &&
|
||||
(evp->len == 0 || strcmp(prev->ev.name, evp->name) == 0));
|
||||
memcmp(prev->ev.name, evp->name, evp->len) == 0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in new issue
Block a user