You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by dc...@apache.org on 2013/05/15 00:19:44 UTC
git commit: updated refs/heads/1493-fix-zerobyte-json-parsing to
02416a1
Updated Branches:
refs/heads/1493-fix-zerobyte-json-parsing [created] 02416a1bc
COUCHDB-1493 include yajl patch in EJSON to avoid skipping unicode zero byte values
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/02416a1b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/02416a1b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/02416a1b
Branch: refs/heads/1493-fix-zerobyte-json-parsing
Commit: 02416a1bcb12fa7391cceddd0268e1c2f2a3fc01
Parents: 73db817
Author: Dave Cottlehuber <dc...@apache.org>
Authored: Mon Apr 8 12:32:32 2013 +0200
Committer: Dave Cottlehuber <dc...@apache.org>
Committed: Wed May 15 00:19:29 2013 +0200
----------------------------------------------------------------------
src/ejson/yajl/yajl_encode.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/02416a1b/src/ejson/yajl/yajl_encode.c
----------------------------------------------------------------------
diff --git a/src/ejson/yajl/yajl_encode.c b/src/ejson/yajl/yajl_encode.c
index ad5b1c5..d5b2b8f 100644
--- a/src/ejson/yajl/yajl_encode.c
+++ b/src/ejson/yajl/yajl_encode.c
@@ -173,6 +173,13 @@ void yajl_string_decode(yajl_buf buf, const unsigned char * str,
Utf32toUtf8(codepoint, utf8Buf);
unescaped = utf8Buf;
+
+ if (codepoint == 0) {
+ yajl_buf_append(buf, unescaped, 1);
+ beg = ++end;
+ continue;
+ }
+
break;
}
default: