bugfix/fs:write Bad buf addr should return EINVAL

return EINVAL if iov_base == NULL

Signed-off-by: guohao15 <guohao15@xiaomi.com>
This commit is contained in:
guohao15
2024-11-18 15:55:26 +08:00
committed by Xiang Xiao
parent ec906cfb0b
commit 14942b5ab4
+5
View File
@@ -71,6 +71,11 @@ static ssize_t file_writev_compat(FAR struct file *filep,
continue;
}
if (iov[i].iov_base == NULL)
{
return -EINVAL;
}
/* Sanity check to avoid total length overflow */
if (SSIZE_MAX - ntotal < iov[i].iov_len)