]> Zhao Yanbai Git Server - minix.git/commitdiff
VFS: fix coverity defects
authorThomas Veerman <thomas@minix3.org>
Tue, 17 Jul 2012 10:29:22 +0000 (10:29 +0000)
committerThomas Veerman <thomas@minix3.org>
Tue, 17 Jul 2012 10:29:22 +0000 (10:29 +0000)
servers/vfs/main.c
servers/vfs/path.c

index 63d434a18ad05b8185a841b98d0b0b5457e6dc50..bfbb110473e0f37212de5ea419404bbbc2bca9ca 100644 (file)
@@ -738,7 +738,7 @@ static void get_work()
        }
 
        proc_p = _ENDPOINT_P(m_in.m_source);
-       if (proc_p < 0) fp = NULL;
+       if (proc_p < 0 || proc_p >= NR_PROCS) fp = NULL;
        else fp = &fproc[proc_p];
 
        if (m_in.m_type == EDEADSRCDST) return; /* Failed 'sendrec' */
index bb9db3a2ce39dde08f4113549f8402513de893ae..ca5182882d519c344089834df14660327987bb28 100644 (file)
@@ -575,7 +575,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 >= &buf[DIR_ENTRIES * DIR_ENTRY_SIZE])
+               if(cur->d_name + name_len+1 >= &buf[DIR_ENTRIES*DIR_ENTRY_SIZE])
                        return(EINVAL); /* Rubbish in dir entry */
                if (entry->v_inode_nr == cur->d_ino) {
                        /* found the entry we were looking for */