diff options
| author | Maxime Coste <mawww@kakoune.org> | 2017-12-01 16:37:18 +0800 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2017-12-01 16:37:18 +0800 |
| commit | 7bfb695c454b6d5ce0bd40e37cc8a57d264c7ce2 (patch) | |
| tree | f6da9dac82e4817732d6d150a5dc875f18f68030 /src | |
| parent | 8d892eeb6256140d6f942f61bda45a8ba99c0027 (diff) | |
Regex: Do not allow private use codepoints literals
We use them to encode non-literals in lookarounds, so they can
trigger bugs.
Fixes #1737
Diffstat (limited to 'src')
| -rw-r--r-- | src/regex_impl.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/regex_impl.cc b/src/regex_impl.cc index 19516f63..91d1816a 100644 --- a/src/regex_impl.cc +++ b/src/regex_impl.cc @@ -292,7 +292,7 @@ private: case '|': case ')': return {}; default: - if (contains("^$.*+?[]{}", cp)) + if (contains("^$.*+?[]{}", cp) or (cp >= 0xF0000 and cp <= 0xFFFFF)) parse_error(format("unexpected '{}'", cp)); ++m_pos; return new_node(ParsedRegex::Literal, cp); |
