Changed paths:
M src/common/regex.cpp
M tests/regex/wxregextest.cpp
Log Message:
-----------
Fix out-of-bounds read on trailing backslash in wxRegEx::Replace()
wxRegExImpl::Replace() scans replacement.c_str() and does *++p after a
backslash. When the replacement ends in a lone backslash, that reads the
terminating NUL, the else branch appends it, and the loop's p++ then
steps one byte past the NUL so the *p condition reads out of bounds.
Keep a trailing backslash verbatim and stop before the increment.
Add a test checking that this doesn't result in ASAN errors any more.