Open
Description
Next entries are considered options when --
is encountered in GNU mode. However, there is no check to ensure that they exist.
In the following test case:
val parser = ArgParser("").apply {
argument(ArgType.String, fullName = "")
prefixStyle = ArgParser.OptionPrefixStyle.GNU
}
val args = arrayOf("--")
parser.parse(args)
Many results can be considered correct:
- String "--" is interpreted as a delimiter between options and arguments, parsing is successful with no options and no arguments
- String "--" is interpreted as an argument and parsing is successful
- String "--" is interpreted as a start of the option and the parser fails with a descriptive error because no options are registered
In practice though, it throws an ArrayOutOfBoundsException
.
Bug is found by fuzzing team @ PLAN Lab.