Skip to content

Commit be25b15

Browse files
AphlitaRbb666
authored andcommitted
drivers/ipc: validate pipe ioctl args
1 parent 3d2dc22 commit be25b15

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

components/drivers/ipc/pipe.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,11 @@ static int pipe_fops_ioctl(struct dfs_file *fd, int cmd, void *args)
190190

191191
pipe = (rt_pipe_t *)fd->vnode->data;
192192

193+
if (args == RT_NULL)
194+
{
195+
return -EINVAL;
196+
}
197+
193198
switch ((rt_ubase_t)cmd)
194199
{
195200
case FIONREAD:

0 commit comments

Comments
 (0)