From 40301da8998a675d7d4e023563727334f5253d47 Mon Sep 17 00:00:00 2001 From: Eitan Adler Date: Sat, 3 Mar 2018 20:42:39 +0000 Subject: [PATCH] sys/fuse: fix off by one error Reported by: Ilja Van Sprundel Reported by: Domagoj Stolfa --- sys/fs/fuse/fuse_internal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/fuse/fuse_internal.c b/sys/fs/fuse/fuse_internal.c index b4fab5521bc3..f8cb51d4549d 100644 --- a/sys/fs/fuse/fuse_internal.c +++ b/sys/fs/fuse/fuse_internal.c @@ -357,7 +357,7 @@ fuse_internal_readdir_processdata(struct uio *uio, memcpy((char *)cookediov->base + sizeof(struct dirent) - MAXNAMLEN - 1, (char *)buf + FUSE_NAME_OFFSET, fudge->namelen); - ((char *)cookediov->base)[bytesavail] = '\0'; + ((char *)cookediov->base)[bytesavail - 1] = '\0'; err = uiomove(cookediov->base, cookediov->len, uio); if (err) {