mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
nshlib/nsh_consolemain: detect null pointer
Returning with an error from nsh_consolemain prevents dereferencing a NULL pointer later in the code.
This commit is contained in:
parent
7981278021
commit
78a6d07a90
1 changed files with 4 additions and 0 deletions
|
|
@ -65,6 +65,10 @@ int nsh_consolemain(int argc, FAR char *argv[])
|
|||
int ret;
|
||||
|
||||
DEBUGASSERT(pstate != NULL);
|
||||
if (pstate == NULL)
|
||||
{
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/* Execute the session */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue