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
@ -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…
Reference in New Issue
Block a user