mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-04-29 12:13:52 +00:00
fuzzer failure --sub1.-
interpreting as a short option (#1148)
and getting into odd situations --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
bc621a95ca
commit
70f98cb218
@ -1974,7 +1974,8 @@ App::_parse_arg(std::vector<std::string> &args, detail::Classifier current_type,
|
||||
}
|
||||
std::string dummy1, dummy2;
|
||||
bool val = false;
|
||||
if(current_type == detail::Classifier::SHORT || detail::split_long(args.back(), dummy1, dummy2)) {
|
||||
if((current_type == detail::Classifier::SHORT && detail::valid_first_char(args.back()[1])) ||
|
||||
detail::split_long(args.back(), dummy1, dummy2)) {
|
||||
val = sub->_parse_arg(args, current_type, true);
|
||||
}
|
||||
|
||||
|
@ -341,7 +341,7 @@ TEST_CASE("app_roundtrip_parse_normal_fail") {
|
||||
// like HorribleErrors
|
||||
CLI::FuzzApp fuzzdata;
|
||||
auto app = fuzzdata.generateApp();
|
||||
int index = GENERATE(range(1, 3));
|
||||
int index = GENERATE(range(1, 4));
|
||||
std::string optionString, flagString;
|
||||
auto parseData = loadFailureFile("parse_fail_check", index);
|
||||
std::size_t pstring_start{0};
|
||||
|
BIN
tests/fuzzFail/parse_fail_check3
Normal file
BIN
tests/fuzzFail/parse_fail_check3
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user