diff options
Diffstat (limited to 'src/common/jsonapi.c')
-rw-r--r-- | src/common/jsonapi.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/jsonapi.c b/src/common/jsonapi.c index 9326f805366..6fe17a3d378 100644 --- a/src/common/jsonapi.c +++ b/src/common/jsonapi.c @@ -738,7 +738,7 @@ json_lex_string(JsonLexContext *lex) ch = (ch * 16) + (*s - 'A') + 10; else { - lex->token_terminator = s + pg_encoding_mblen(lex->input_encoding, s); + lex->token_terminator = s + pg_encoding_mblen_bounded(lex->input_encoding, s); return JSON_UNICODE_ESCAPE_FORMAT; } } @@ -844,7 +844,7 @@ json_lex_string(JsonLexContext *lex) default: /* Not a valid string escape, so signal error. */ lex->token_start = s; - lex->token_terminator = s + pg_encoding_mblen(lex->input_encoding, s); + lex->token_terminator = s + pg_encoding_mblen_bounded(lex->input_encoding, s); return JSON_ESCAPING_INVALID; } } @@ -858,7 +858,7 @@ json_lex_string(JsonLexContext *lex) * shown it's not a performance win. */ lex->token_start = s; - lex->token_terminator = s + pg_encoding_mblen(lex->input_encoding, s); + lex->token_terminator = s + pg_encoding_mblen_bounded(lex->input_encoding, s); return JSON_ESCAPING_INVALID; } |