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

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


The following commit(s) were added to refs/heads/master by this push:
     new d071a0b58 fix: V-001 security vulnerability
d071a0b58 is described below

commit d071a0b585f7e292e4bc5e792cc0aaa21ea4266e
Author: orbisai0security <[email protected]>
AuthorDate: Thu Jul 9 00:50:36 2026 +0000

    fix: V-001 security vulnerability
    
    Automated security fix generated by OrbisAI Security
    
    Signed-off-by: OrbisAI Security <[email protected]>
---
 nshlib/nsh_vars.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/nshlib/nsh_vars.c b/nshlib/nsh_vars.c
index f940d64a3..401d90670 100644
--- a/nshlib/nsh_vars.c
+++ b/nshlib/nsh_vars.c
@@ -257,6 +257,11 @@ int nsh_setvar(FAR struct nsh_vtbl_s *vtbl, FAR const char 
*name,
 
   if (pstate->varp != NULL)
     {
+      if (varlen > INT_MAX - pstate->varsz)
+        {
+          return -ENOMEM;
+        }
+
       newsize = pstate->varsz + varlen;
       newvarp = (FAR char *)realloc(pstate->varp, newsize);
       if (newvarp == NULL)

Reply via email to