Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 5f8b431

Browse files
committed
Use correct length to convert json unicode escapes.
Bug reported on IRC - fix due to Andrew Gierth.
1 parent 50c1374 commit 5f8b431

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/utils/adt/json.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ json_lex_string(JsonLexContext *lex)
721721
unicode_to_utf8(ch, (unsigned char *) utf8str);
722722
utf8len = pg_utf_mblen((unsigned char *) utf8str);
723723
utf8str[utf8len] = '\0';
724-
converted = pg_any_to_server(utf8str, 1, PG_UTF8);
724+
converted = pg_any_to_server(utf8str, utf8len, PG_UTF8);
725725
appendStringInfoString(lex->strval, converted);
726726
if (converted != utf8str)
727727
pfree(converted);

0 commit comments

Comments
 (0)