diff --git a/src/regex_impl.cc b/src/regex_impl.cc index 2161d113..3dc8bd6b 100644 --- a/src/regex_impl.cc +++ b/src/regex_impl.cc @@ -340,7 +340,7 @@ private: case '|': case ')': return {}; default: - if (contains("^$.*+?[]{}", cp) or (cp >= 0xF0000 and cp <= 0xFFFFF)) + if (contains(StringView{"^$.*+?[]{}"}, cp) or (cp >= 0xF0000 and cp <= 0xFFFFF)) parse_error(format("unexpected '{}'", cp)); ++m_pos; return add_node(ParsedRegex::Literal, cp); diff --git a/test/regression/4460-nul-byte-in-regex/cmd b/test/regression/4460-nul-byte-in-regex/cmd new file mode 100644 index 00000000..660eddfb --- /dev/null +++ b/test/regression/4460-nul-byte-in-regex/cmd @@ -0,0 +1 @@ +*%sd diff --git a/test/regression/4460-nul-byte-in-regex/in b/test/regression/4460-nul-byte-in-regex/in new file mode 100644 index 00000000..bd474b25 Binary files /dev/null and b/test/regression/4460-nul-byte-in-regex/in differ diff --git a/test/regression/4460-nul-byte-in-regex/out b/test/regression/4460-nul-byte-in-regex/out new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/test/regression/4460-nul-byte-in-regex/out @@ -0,0 +1 @@ +