VFS: fix off-by-one in get_name()
This commit is contained in:
parent
130b082121
commit
766047123a
1 changed files with 1 additions and 1 deletions
|
@ -620,7 +620,7 @@ char ename[NAME_MAX + 1];
|
|||
cur = (struct dirent *) (buf + consumed);
|
||||
name_len = cur->d_reclen - offsetof(struct dirent, d_name) - 1;
|
||||
|
||||
if(cur->d_name + name_len+1 >= &buf[DIR_ENTRIES*DIR_ENTRY_SIZE])
|
||||
if(cur->d_name + name_len+1 > &buf[sizeof(buf)])
|
||||
return(EINVAL); /* Rubbish in dir entry */
|
||||
if (entry->v_inode_nr == cur->d_ino) {
|
||||
/* found the entry we were looking for */
|
||||
|
|
Loading…
Reference in a new issue