aboutsummaryrefslogtreecommitdiff
path: root/wildcard_cmp.c
Commit message (Collapse)AuthorAgeFilesLines
* wildcard_cmp.c: Fix out-of-bounds cmpXavier Del Campo Romero2023-07-091-1/+2
| | | | | | | | | | | | | | | When the distance between '*' on a wildcard expression was larger than the string to compare with, this would cause an out-of-bounds read because `n` was not being limited to the strlen(3) from the input string. Example: - s="c", p="*cc*", casecmp=false Here, the distance between the first and second '*' is 2 bytes, which is longer than the input string itself (1 byte, not counting the terminating null byte '\0').
* wildcard_cmp.c: Fix a couple of bugsXavier Del Campo Romero2023-06-061-3/+22
| | | | | | | wildcard_cmp would otherwise fail with the following use cases: s = "mymi", p = "*mi*" s = "mymi", p = "*mi"
* wildcard_cmp.c: Remove leftoversXavier Del Campo Romero2023-06-061-4/+0
| | | | | These statements had no effect since it was always executed when n == 0.
* wildcard_cmp: Allow case-insensitive searchesXavier Del Campo Romero2023-06-061-12/+25
| | | | The new search feature will require them.
* Split wildcard_cmp into its own componentXavier Del Campo Romero2023-06-061-0/+44
Future commits will make use of this function outside handler.c.