this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Return EFAULT on NULL input filename in stat family of syscalls

Fixes crashes of vim

+23
+7
src/kernel/emulation/linux/stat/fstatat.c
··· 7 7 #include <lkm/api.h> 8 8 #include <mach/lkm.h> 9 9 #include <linux-syscalls/linux.h> 10 + #include "../../../../../platform-include/sys/errno.h" 10 11 11 12 extern char* strcpy(char* dst, const char* src); 12 13 ··· 17 18 int ret; 18 19 struct linux_stat lstat; 19 20 int linux_flags; 21 + 22 + if (!path) 23 + return -EFAULT; 20 24 21 25 struct vchroot_expand_args vc; 22 26 vc.flags = (flag & AT_SYMLINK_NOFOLLOW) ? 0 : VCHROOT_FOLLOW; ··· 48 52 int ret; 49 53 struct linux_stat lstat; 50 54 int linux_flags; 55 + 56 + if (!path) 57 + return -EFAULT; 51 58 52 59 struct vchroot_expand_args vc; 53 60 vc.flags = (flag & AT_SYMLINK_NOFOLLOW) ? 0 : VCHROOT_FOLLOW;
+4
src/kernel/emulation/linux/stat/lstat.c
··· 7 7 #include <mach/lkm.h> 8 8 #include "../vchroot_expand.h" 9 9 #include "../bsdthread/per_thread_wd.h" 10 + #include "../../../../../platform-include/sys/errno.h" 10 11 11 12 long sys_lstat(const char* path, struct stat* stat) 12 13 { 13 14 int ret; 14 15 struct linux_stat lstat; 15 16 struct vchroot_expand_args vc; 17 + 18 + if (!path) 19 + return -EFAULT; 16 20 17 21 vc.flags = 0; 18 22 vc.dfd = get_perthread_wd();
+4
src/kernel/emulation/linux/stat/mkdirat.c
··· 7 7 #include "../vchroot_expand.h" 8 8 #include <lkm/api.h> 9 9 #include <mach/lkm.h> 10 + #include "../../../../../platform-include/sys/errno.h" 10 11 11 12 extern char* strcpy(char* dst, const char* src); 12 13 ··· 14 15 { 15 16 int ret; 16 17 struct vchroot_expand_args vc; 18 + 19 + if (!path) 20 + return -EFAULT; 17 21 18 22 vc.flags = 0; 19 23 vc.dfd = atfd(fd);
+4
src/kernel/emulation/linux/stat/mkfifo.c
··· 7 7 #include "../vchroot_expand.h" 8 8 #include <lkm/api.h> 9 9 #include <mach/lkm.h> 10 + #include "../../../../../platform-include/sys/errno.h" 10 11 11 12 #define LINUX_S_IFIFO 0010000 12 13 ··· 14 15 { 15 16 int ret; 16 17 struct vchroot_expand_args vc; 18 + 19 + if (!path) 20 + return -EFAULT; 17 21 18 22 vc.flags = 0; 19 23 vc.dfd = get_perthread_wd();
+4
src/kernel/emulation/linux/stat/rmdir.c
··· 7 7 #include "../vchroot_expand.h" 8 8 #include <lkm/api.h> 9 9 #include <mach/lkm.h> 10 + #include "../../../../../platform-include/sys/errno.h" 10 11 11 12 #define LINUX_AT_REMOVEDIR 0x200 12 13 ··· 14 15 { 15 16 int ret; 16 17 struct vchroot_expand_args vc; 18 + 19 + if (!path) 20 + return -EFAULT; 17 21 18 22 vc.flags = 0; 19 23 vc.dfd = get_perthread_wd();