unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Philipp <p.stephani2@gmail.com>
To: Peter <craven@gmx.net>
Cc: 48274@debbugs.gnu.org
Subject: bug#48274: 27.2; libjanson: \u0000 is not allowed without JSON_ALLOW_NUL
Date: Sat, 8 May 2021 11:24:31 +0200	[thread overview]
Message-ID: <5C06F5D0-AED3-4C34-BC5A-9FA7A9D6C658@gmail.com> (raw)
In-Reply-To: <87r1ijhv2u.fsf@nexoid.at>



> Am 07.05.2021 um 09:16 schrieb Peter <craven@gmx.net>:
> 
> Hello ;)
> 
> It seems that Emacs' `json-parse-buffer' cannot correctly parse strings
> that contain an escaped ascii 0 value.
> 
> To reproduce:
> 
> - Create a new buffer, insert into it:
>  { "foo": "this is a string including a literal \u0000" }
> - Move point to the beginning of the buffer [ M-< ]
> - Execute `json-parse-buffer' [ M-: (json-parse-buffer) ]
> - See the error message.
> 
> According to all other systems I've tried, \u0000 is valid in json
> strings.
> 
> The error message seems to imply that something (probably libjanson?)
> should be compiled with -DJSON_ALLOW_NUL.
> 
> As this seems to be non-conformant behaviour, is there a way to change
> this in the default Emacs build?

We use the default behavior of Jansson here, see the remark about JSON_ALLOW_NUL in https://jansson.readthedocs.io/en/2.13/apiref.html#decoding.
I wouldn't mind allowing escaped NUL characters though; Emacs should be able to handle them just fine.
Also see the FIXME in the unit test `json-parse-string/null' in tests/src/json-tests.el.




  reply	other threads:[~2021-05-08  9:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-07  7:16 bug#48274: 27.2; libjanson: \u0000 is not allowed without JSON_ALLOW_NUL Peter
2021-05-08  9:24 ` Philipp [this message]
2021-05-11 13:31   ` Lars Ingebrigtsen
2022-07-02 13:06   ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5C06F5D0-AED3-4C34-BC5A-9FA7A9D6C658@gmail.com \
    --to=p.stephani2@gmail.com \
    --cc=48274@debbugs.gnu.org \
    --cc=craven@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).