Message ID | 20190706185252.32488-3-trond.myklebust@hammerspace.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/3] NFS: Fix off-by-one errors in nfs_readdir | expand |
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 6ccf0e6c9c84..7313084424bb 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -189,7 +189,7 @@ static int nfs_readdir_make_qstr(struct qstr *string, const char *name, unsigned int len) { string->len = len; - string->name = kmemdup(name, len, GFP_KERNEL); + string->name = kmemdup_nul(name, len, GFP_KERNEL);; if (string->name == NULL) return -ENOMEM; /*
Strictly speaking, struct qstr does not require a NUL terminated string, but in practice all dentries are deliberately stored that way. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> --- fs/nfs/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)