mirror of https://github.com/jarro2783/cxxopts.git
Fixes potential segmentation fault in edge cases.
Check for null pointer before accessing argv[current] in OptionParser::parse() to handle invalid argument scenarios that can occur with over-processed command line arguments.
This commit is contained in:
parent
80cb4520f7
commit
b3ec683892
|
|
@ -2519,7 +2519,7 @@ OptionParser::parse(int argc, const char* const* argv)
|
|||
|
||||
std::vector<std::string> unmatched;
|
||||
|
||||
while (current != argc)
|
||||
while (current < argc)
|
||||
{
|
||||
if (strcmp(argv[current], "--") == 0)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue