pkarashchenko commented on code in PR #6423:
URL: https://github.com/apache/incubator-nuttx/pull/6423#discussion_r895860595


##########
sched/environ/env_unsetenv.c:
##########
@@ -61,23 +61,30 @@ int unsetenv(FAR const char *name)
 {
   FAR struct tcb_s *rtcb = this_task();
   FAR struct task_group_s *group = rtcb->group;
-  int ret = OK;
+  int idx;
 
-  DEBUGASSERT(name && group);
+  DEBUGASSERT(group);
+
+  /* Check the incoming parameter */
+
+  if (name == NULL || *name == '\0' || strchr (name, '=') != NULL)

Review Comment:
   Just made a quick test with Linux and got the next compilation warning:
   ```
   test.c: In function ‘main’:
   test.c:13:11: warning: null argument where non-null required (argument 1) 
[-Wnonnull]
      13 | int ret = unsetenv(NULL);
   ```
   and execution result:
   ```
   unsetenv(NULL) ret -1, errno 22
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to