mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 05:55:46 +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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (iov[i].iov_base == NULL)
|
||||||
|
{
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Sanity check to avoid total length overflow */
|
/* Sanity check to avoid total length overflow */
|
||||||
|
|
||||||
if (SSIZE_MAX - ntotal < iov[i].iov_len)
|
if (SSIZE_MAX - ntotal < iov[i].iov_len)
|
||||||
|
|||||||
Reference in New Issue
Block a user