This is an automated email from the ASF dual-hosted git repository. pkarashchenko pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit dc2b2dcb3f7f4561f880fbbbaa60fab90984ffa4 Author: Ville Juven <ville.ju...@unikie.com> AuthorDate: Mon Jun 13 15:51:12 2022 +0300 sched/env: Check for incoming parameter validity in unsetenv() Something the function did not do, check the incoming parameter is vlaid --- sched/environ/env_unsetenv.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sched/environ/env_unsetenv.c b/sched/environ/env_unsetenv.c index be491474c4..62f9fd8a99 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 */