fix a fuzzing issue from a string as a bracket (#1110)

fix fuzzing issue

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Philip Top
2025-01-03 07:47:09 -08:00
committed by GitHub
parent d2b331f02a
commit f41e59b7f6
7 changed files with 88 additions and 15 deletions

View File

@@ -259,6 +259,26 @@ The config parser has a modifier
This modification will insert the separator between each line even if not
sequential. This allows an input option to be configured with multiple lines.
```toml
# Examples of vector of vector inputs in config
# this example is how config_to_str writes it out
vector1 = [a,v,"[]"]
```
The field insertion has a special processing for duplicate characters starting
with "[[" in which case the `"[]"` gets translated to `[[]]` before getting
passed into the option which converts it back into the correct string. This can
also be used on the command line to handle unusual parsing situation with
brackets.
### Argument With Brackets
There is an edge case with actual strings that are surrounded by brackets. For
example if the string "[]" needed to be passed. this would normally trigger the
bracket processing and result in an empty vector. In this case it can be
enclosed in quotes and should be handled correctly.
## Multiple configuration files
If it is desired that multiple configuration be allowed. Use