couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dave Cottlehuber (JIRA)" <>
Subject [jira] [Updated] (COUCHDB-1493) null byte in string data dropped
Date Mon, 08 Apr 2013 12:11:16 GMT


Dave Cottlehuber updated COUCHDB-1493:

    Attachment: yajl.patch

Eli, this is a bug in ejson, inherited from yajl. There's a simple patch attached, which works,
modified from Conrad's original one for yajl, but I haven't done tests yet. Perhaps you might
get to them before me? :D

Either JS or erlang should be fine, in erlang useful bits are:

EJson = {[{<<"b">>,<<98,0,98>>}]}.
Json = <<"{\"b\":\"b\\u0000b\"}">>.
EJson = ejson:decode(Json).
Json = ejson:encode(EJson).

NB I'd port all of the ejson/yajl changes but it is better simply to move to jiffy directly

> null byte in string data dropped
> --------------------------------
>                 Key: COUCHDB-1493
>                 URL:
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Database Core
>    Affects Versions: 1.2
>            Reporter: Eli Stevens
>            Assignee: Dave Cottlehuber
>         Attachments: yajl.patch
>  curl -X POST http://localhost:5984/test/ -H "Content-Type: application/json" -d '{"b":"b\u0000b"}'
> Results in the following document:
> {
>    "_id": "abd492c1f26d0b404111b2324c004537",
>    "_rev": "1-b7d9864e38fd32678f0e7994f6672709",
>    "b": "bb"
> }
> I'm not sure what the intended behavior is, but it's a change from 1.1 (1.1.1?  I don't
recall the exact version I had before upgrading).

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message