This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new e15fe23424 procfs:fix cmdline overflow
e15fe23424 is described below

commit e15fe23424fec6e745c126eb2f5df86ae23edc3a
Author: anjiahao <[email protected]>
AuthorDate: Wed Dec 11 19:58:32 2024 +0800

    procfs:fix cmdline overflow
    
    Signed-off-by: anjiahao <[email protected]>
---
 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;

Reply via email to