Просмотр исходного кода

drivers/ipc: validate pipe ioctl args

Aphlita 1 день назад
Родитель
Сommit
be25b15cc6
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      components/drivers/ipc/pipe.c

+ 5 - 0
components/drivers/ipc/pipe.c

@@ -190,6 +190,11 @@ static int pipe_fops_ioctl(struct dfs_file *fd, int cmd, void *args)
 
     pipe = (rt_pipe_t *)fd->vnode->data;
 
+    if (args == RT_NULL)
+    {
+        return -EINVAL;
+    }
+
     switch ((rt_ubase_t)cmd)
     {
     case FIONREAD: