git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 50c1374)
Use correct length to convert json unicode escapes.
Wed, 1 May 2013 22:47:18 +0000 (18:47 -0400)
Wed, 1 May 2013 22:47:18 +0000 (18:47 -0400)
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 90404f34effd1988ac66a186a8d8a09b8d1ae1bc..507c91ff97b2fd30269c1d4a450e7b72e2cf0e07 100644 (file)
--- 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);
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /