sched/env: Check for incoming parameter validity in unsetenv()
Something the function did not do, check the incoming parameter is vlaid
This commit is contained in:
parent
1b32fc1642
commit
dc2b2dcb3f
|
@ -63,7 +63,15 @@ int unsetenv(FAR const char *name)
|
|||
FAR struct task_group_s *group = rtcb->group;
|
||||
int idx;
|
||||
|
||||
DEBUGASSERT(name && group);
|
||||
DEBUGASSERT(group);
|
||||
|
||||
/* Check the incoming parameter */
|
||||
|
||||
if (name == NULL || *name == '\0' || strchr(name, '=') != NULL)
|
||||
{
|
||||
set_errno(EINVAL);
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
/* Check if the variable exists */
|
||||
|
||||
|
|
Loading…
Reference in New Issue