Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use assertion to ensure erroroffset return from pcre2_compile is valid
When testing the new pattern rewriting phase for regex compilation using a fuzzer, I had a scary experience. Due to a bug in my pattern rewriting code, pcre2_compile() could return a totally invalid erroroffset. If a library user tried to do something with the erroroffset without checking it for validity, in the worst case, this had the potential to lead to an RCE vulnerability. In case something similar ever happens again, I've added an assertion which will make it easier to notice the problem.
- Loading branch information