mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
fix: V-001 security vulnerability
Automated security fix generated by OrbisAI Security Signed-off-by: OrbisAI Security <mediratta01.pally@gmail.com>
This commit is contained in:
parent
33b528a0de
commit
d071a0b585
1 changed files with 5 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue