]> xenbits.xensource.com Git - freebsd.git/commitdiff
Fix an off-by-one error from r351961
authorasomers <asomers@FreeBSD.org>
Mon, 16 Sep 2019 16:41:01 +0000 (16:41 +0000)
committerasomers <asomers@FreeBSD.org>
Mon, 16 Sep 2019 16:41:01 +0000 (16:41 +0000)
That revision addressed a Coverity CID that could lead to a buffer overflow,
but it had an off-by-one error in the buffer size check.

Reported by: Coverity
Coverity CID: 1405530
MFC after: 3 days
MFC-With: 351961
Sponsored by: The FreeBSD Foundation

sys/fs/fuse/fuse_internal.c

index ba9b77c44dc1d4de899b9afa983e11a438ebfcd6..a3fceb0e13602480e9abc219f3b6d5225026cb39 100644 (file)
@@ -390,7 +390,7 @@ fuse_internal_invalidate_entry(struct mount *mp, struct uio *uio)
        if ((err = uiomove(&fnieo, sizeof(fnieo), uio)) != 0)
                return (err);
 
-       if (fnieo.namelen > sizeof(name))
+       if (fnieo.namelen >= sizeof(name))
                return (EINVAL);
 
        if ((err = uiomove(name, fnieo.namelen, uio)) != 0)