mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 19:36:35 +08:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user