pkarashchenko commented on a change in pull request #5004:
URL: https://github.com/apache/incubator-nuttx/pull/5004#discussion_r769390280
##########
File path: libs/libc/unistd/lib_getopt_common.c
##########
@@ -394,7 +394,7 @@ int getopt_common(int argc, FAR char * const argv[],
/* Check for the end of the argument list */
go->go_optptr = argv[go->go_optind];
- if (!go->go_optptr)
+ if (!go->go_optptr || go->go_optind >= argc)
Review comment:
maybe better to check `go->go_optind >= argc` before accessing
`argv[go->go_optind]` above?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]