From be25b15cc65ec62c203a71e3527ae6bb667b2bcd Mon Sep 17 00:00:00 2001 From: Aphlita Date: Thu, 7 May 2026 15:39:45 +0800 Subject: drivers/ipc: validate pipe ioctl args --- components/drivers/ipc/pipe.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'components/drivers') diff --git a/components/drivers/ipc/pipe.c b/components/drivers/ipc/pipe.c index 64540eade1..7471d55807 100644 --- a/components/drivers/ipc/pipe.c +++ b/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: -- cgit v1.3.1