diff --git a/sched/environ/env_unsetenv.c b/sched/environ/env_unsetenv.c index be491474c4d..62f9fd8a99e 100644 --- a/sched/environ/env_unsetenv.c +++ b/sched/environ/env_unsetenv.c @@ -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 */