summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Cottlehuber <dch@apache.org>2013-04-08 12:32:32 +0200
committerDave Cottlehuber <dch@apache.org>2013-05-15 00:19:29 +0200
commit02416a1bcb12fa7391cceddd0268e1c2f2a3fc01 (patch)
tree5f0d817b453e04a07f203d3e88706939583c79b6
parent73db8179323c01bdd40eda2d587d52588f30a60f (diff)
downloadcouchdb-1493-fix-zerobyte-json-parsing.tar.gz
COUCHDB-1493 include yajl patch in EJSON to avoid skipping unicode zero byte values1493-fix-zerobyte-json-parsing
-rw-r--r--src/ejson/yajl/yajl_encode.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ejson/yajl/yajl_encode.c b/src/ejson/yajl/yajl_encode.c
index ad5b1c591..d5b2b8f0d 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: