mirror of
https://github.com/postgres/postgres.git
synced 2025-06-13 07:41:39 +03:00
Use correct length to convert json unicode escapes.
Bug reported on IRC - fix due to Andrew Gierth.
This commit is contained in:
@ -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);
|
||||||
|
Reference in New Issue
Block a user