diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2014-12-17 02:52:26 +0300 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-01-30 20:43:30 -0500 |
commit | c7c545d4a34872f4a3d710e22f21fb61f7258706 (patch) | |
tree | 4722f62ab165f67b6637be5783b034a5bda20729 /fs/nfs/nfsroot.c | |
parent | 3a7ed3fff3bb22828f7d7ba6b75c7d22ee54df38 (diff) | |
download | lwn-c7c545d4a34872f4a3d710e22f21fb61f7258706.tar.gz lwn-c7c545d4a34872f4a3d710e22f21fb61f7258706.zip |
NFS: a couple off by ones
These tests are off by one because if len == sizeof(nfs_export_path)
then we have truncated the name.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/nfsroot.c')
-rw-r--r-- | fs/nfs/nfsroot.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfs/nfsroot.c b/fs/nfs/nfsroot.c index cd3c910d2d12..9bc9f04fb7f6 100644 --- a/fs/nfs/nfsroot.c +++ b/fs/nfs/nfsroot.c @@ -261,11 +261,11 @@ static int __init root_nfs_data(char *cmdline) */ len = snprintf(nfs_export_path, sizeof(nfs_export_path), tmp, utsname()->nodename); - if (len > (int)sizeof(nfs_export_path)) + if (len >= (int)sizeof(nfs_export_path)) goto out_devnametoolong; len = snprintf(nfs_root_device, sizeof(nfs_root_device), "%pI4:%s", &servaddr, nfs_export_path); - if (len > (int)sizeof(nfs_root_device)) + if (len >= (int)sizeof(nfs_root_device)) goto out_devnametoolong; retval = 0; |