aboutsummaryrefslogtreecommitdiff
path: root/wildcard_cmp.c
Commit message (Collapse)AuthorAgeFilesLines
* Move header files to subdirectoryXavier Del Campo Romero2023-07-211-1/+1
| | | | | | | | | | | Since slweb is meant as a library, it is advisable to keep public header files under their own directory in order to avoid name clashing i.e., #include "something.h" Now becomes: #include "slweb/something.h"
* wildcard_cmp.c: Fix out-of-bounds cmpXavier Del Campo Romero2023-07-201-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-07-201-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-07-201-4/+0
| | | | | These statements had no effect since it was always executed when n == 0.
* wildcard_cmp: Allow case-insensitive searchesXavier Del Campo Romero2023-07-201-12/+25
| | | | The new search feature will require them.
* Split wildcard_cmp into its own componentXavier Del Campo Romero2023-07-201-0/+44
Future commits will make use of this function outside handler.c.