diff --git a/fs/vfs/fs_write.c b/fs/vfs/fs_write.c index 8d4cc5da294..168538b569f 100644 --- a/fs/vfs/fs_write.c +++ b/fs/vfs/fs_write.c @@ -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)