]> git.ipfire.org Git - thirdparty/libvirt.git/commit
json: reject javascript comments
authorEric Blake <eblake@redhat.com>
Mon, 22 Jun 2015 20:18:33 +0000 (14:18 -0600)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 25 Jun 2015 07:11:15 +0000 (09:11 +0200)
commit54dbba5bc3e5bc177b0d806849e44d81192d1168
tree3344673b15609d298d0782fc02bfe84c15334ee3
parentf2acaebd4085b663f7ab6566b22fe21e68f65ec9
json: reject javascript comments

We have been allowing javascript style comments in JSON ever
since commit 9428f2c (v0.7.5), but qemu doesn't send them, and
they are not strict JSON.  Reject them for now; if we can later
prove that it is worthwhile, we can reinstate it at that point
(or even make it conditional, by adding a bool parameter to
the libvirt entry point).

* src/util/virjson.c (virJSONValueFromString): Don't enable
comment parsing.
* tests/jsontest.c (mymain): Test it.

Signed-off-by: Eric Blake <eblake@redhat.com>
src/util/virjson.c
tests/jsontest.c