mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-26 18:43:33 -05:00
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>
This commit is contained in:
parent
3a7ed3fff3
commit
c7c545d4a3
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue