summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAphlita <[email protected]>2026-05-07 15:39:45 +0800
committerRbb666 <[email protected]>2026-05-08 20:18:31 +0800
commitbe25b15cc65ec62c203a71e3527ae6bb667b2bcd (patch)
tree22019346d909e30ce9eeba786428f77cd105ac8c
parent3d2dc22c58414f7a0c34c2ad362f46b0a108b1fb (diff)
drivers/ipc: validate pipe ioctl args
-rw-r--r--components/drivers/ipc/pipe.c5
1 files changed, 5 insertions, 0 deletions
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: