From 5e4c14d8e8c5acb1f2886a59e8c80d4d9285b54c Mon Sep 17 00:00:00 2001 From: anjiahao Date: Wed, 11 Dec 2024 19:58:32 +0800 Subject: [PATCH] procfs:fix cmdline overflow Signed-off-by: anjiahao --- fs/procfs/fs_procfsproc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/procfs/fs_procfsproc.c b/fs/procfs/fs_procfsproc.c index f682e9784d..020dbbf06c 100644 --- a/fs/procfs/fs_procfsproc.c +++ b/fs/procfs/fs_procfsproc.c @@ -687,9 +687,9 @@ static ssize_t proc_cmdline(FAR struct proc_file_s *procfile, /* Show the task / thread argument list (skipping over the name) */ - linesize = nxtask_argvstr(tcb, procfile->line, remaining); + linesize = nxtask_argvstr(tcb, procfile->line, sizeof(procfile->line)); copysize = procfs_memcpy(procfile->line, linesize, buffer, - remaining, &offset); + sizeof(procfile->line), &offset); totalsize += copysize; buffer += copysize; remaining -= copysize;