binfmt: Check return pointer.
Function builtin_for_index may return NULL. We must check this to prevent visit invalid address. Signed-off-by: xiangdong6 <xiangdong6@xiaomi.com>
This commit is contained in:
parent
c5785ee9d5
commit
4cd4303c32
@ -97,6 +97,12 @@ static int builtin_loadbinary(FAR struct binary_s *binp,
|
||||
*/
|
||||
|
||||
builtin = builtin_for_index(index);
|
||||
if (builtin == NULL)
|
||||
{
|
||||
berr("ERROR: %s is not a builtin application\n", filename);
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
binp->entrypt = builtin->main;
|
||||
binp->stacksize = builtin->stacksize;
|
||||
binp->priority = builtin->priority;
|
||||
|
Loading…
Reference in New Issue
Block a user