Fix: lmdb regex match on non-null-terminated string by martinhsv · Pull Request #2985 · owasp-modsecurity/ModSecurity (original) (raw)

The old code was providing the pointer from the lmdb API directly to the regex search function. The pointer points to a correct sequence of bytes for the key, but it is not null terminated.

This issue would primarily affect lmdb match scenarios where the ending of the key would affect the search -- for example if the regular expression used an end-anchor ('$').