mirror of
https://github.com/postgres/postgres.git
synced 2025-04-25 21:42:33 +03:00
Use correct length to convert json unicode escapes.
Bug reported on IRC - fix due to Andrew Gierth.
This commit is contained in:
parent
50c137487c
commit
5f8b4319b9
@ -721,7 +721,7 @@ json_lex_string(JsonLexContext *lex)
|
|||||||
unicode_to_utf8(ch, (unsigned char *) utf8str);
|
unicode_to_utf8(ch, (unsigned char *) utf8str);
|
||||||
utf8len = pg_utf_mblen((unsigned char *) utf8str);
|
utf8len = pg_utf_mblen((unsigned char *) utf8str);
|
||||||
utf8str[utf8len] = '\0';
|
utf8str[utf8len] = '\0';
|
||||||
converted = pg_any_to_server(utf8str, 1, PG_UTF8);
|
converted = pg_any_to_server(utf8str, utf8len, PG_UTF8);
|
||||||
appendStringInfoString(lex->strval, converted);
|
appendStringInfoString(lex->strval, converted);
|
||||||
if (converted != utf8str)
|
if (converted != utf8str)
|
||||||
pfree(converted);
|
pfree(converted);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user