From: Andrew Dunstan Date: Wed, 1 May 2013 22:47:18 +0000 (-0400) Subject: Use correct length to convert json unicode escapes. X-Git-Tag: REL9_3_BETA1~26 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5f8b4319b94476de715ffef9183227ac6f4925c0;p=postgresql Use correct length to convert json unicode escapes. Bug reported on IRC - fix due to Andrew Gierth. --- diff --git a/src/backend/utils/adt/json.c b/src/backend/utils/adt/json.c index 90404f34ef..507c91ff97 100644 --- a/src/backend/utils/adt/json.c +++ b/src/backend/utils/adt/json.c @@ -721,7 +721,7 @@ json_lex_string(JsonLexContext *lex) unicode_to_utf8(ch, (unsigned char *) utf8str); utf8len = pg_utf_mblen((unsigned char *) utf8str); 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); if (converted != utf8str) pfree(converted);