aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval/decode.c
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2016-03-07 07:27:14 +0300
committerZyX <kp-pav@yandex.ru>2016-04-18 02:48:20 +0300
commit394830631f130ad646f23358bf7863e7a37c6d78 (patch)
treed92f08c3d8a64386e47b31ade25b4c08e17103ad /src/nvim/eval/decode.c
parentb725f6b4287d800f22bce32f32022ad07aa2610e (diff)
downloadrneovim-394830631f130ad646f23358bf7863e7a37c6d78.tar.gz
rneovim-394830631f130ad646f23358bf7863e7a37c6d78.tar.bz2
rneovim-394830631f130ad646f23358bf7863e7a37c6d78.zip
eval/decode: Make sure that U+00C3 is parsed correctly
Diffstat (limited to 'src/nvim/eval/decode.c')
-rw-r--r--src/nvim/eval/decode.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/eval/decode.c b/src/nvim/eval/decode.c
index 35e8421716..ce2723147d 100644
--- a/src/nvim/eval/decode.c
+++ b/src/nvim/eval/decode.c
@@ -431,7 +431,10 @@ json_decode_string_cycle_start:
// and thus cannot possibly be equal to *p. But utf_ptr2char({0xFF,
// 0}) will return 0xFF, even though 0xFF cannot start any UTF-8
// code point at all.
- if (ch >= 0x80 && p_byte == ch) {
+ //
+ // The only exception is U+00C3 which is represented as 0xC3 0x83.
+ if (ch >= 0x80 && p_byte == ch && !(
+ ch == 0xC3 && p + 1 < e && (uint8_t) p[1] == 0x83)) {
EMSG2(_("E474: Only UTF-8 strings allowed: %s"), p);
goto json_decode_string_fail;
} else if (ch > 0x10FFFF) {