diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2019-06-11 12:10:17 -0600 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2019-06-11 12:10:17 -0600 |
| commit | 3224d207a64b748dd2b7f680e9edff4c208e4d76 (patch) | |
| tree | ee24a2a3740563aecfab9fdc922eafebf1527c97 /include | |
| parent | a7c2aeb0b779476ba277e49abf5d1af728a65ca0 (diff) | |
Fix segfaults caused by faulty command parsing
This patch fixes faulty command parsing introduced by
482bcb78e6fa356c28d685552e2409e4c9c66714. When that commit allowed
criteria reset on ';' delimeters in commands lists, it failed to account
for its inner ','-parsing loop eating threw the entire rest of the
string.
This patch refactors argsep to use a list of multiple separators, and
(optionally) return the separator that it matched against in this
iteration via a pointer. This allows it to hint at the command parser
which separator was used at the end of the last command, allowing it to
trigger a potential secondary read of the criteria.
Fixes #4239
Diffstat (limited to 'include')
| -rw-r--r-- | include/stringop.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/stringop.h b/include/stringop.h index 6f920999..2aabcee7 100644 --- a/include/stringop.h +++ b/include/stringop.h @@ -24,6 +24,6 @@ int unescape_string(char *string); char *join_args(char **argv, int argc); // Split string into 2 by delim, handle quotes -char *argsep(char **stringp, const char *delim); +char *argsep(char **stringp, const char *delim, char *matched_delim); #endif |
