mirror of
https://github.com/clearlinux/graphene.git
synced 2026-08-24 08:07:15 +00:00
Fix null test and write test issues about the stat parameter
This issue may cause SegFault if pass null to state, and miss the validation by test_user_memory(...) if not null.
This commit is contained in:
@@ -39,7 +39,7 @@ int shim_do_stat (const char * file, struct stat * stat)
|
||||
if (!file || test_user_string(file))
|
||||
return -EFAULT;
|
||||
|
||||
if (!stat && test_user_memory(stat, sizeof(*stat), true))
|
||||
if (!stat || test_user_memory(stat, sizeof(*stat), true))
|
||||
return -EFAULT;
|
||||
|
||||
int ret;
|
||||
@@ -67,7 +67,7 @@ int shim_do_lstat (const char * file, struct stat * stat)
|
||||
if (!file || test_user_string(file))
|
||||
return -EFAULT;
|
||||
|
||||
if (!stat && test_user_memory(stat, sizeof(*stat), true))
|
||||
if (!stat || test_user_memory(stat, sizeof(*stat), true))
|
||||
return -EFAULT;
|
||||
|
||||
int ret;
|
||||
|
||||
Reference in New Issue
Block a user