json: Correctly handle bad strings with missing closing quotes

Also add a test for this case.

Signed-off-by: Arun Raghavan <arun@arunraghavan.net>
This commit is contained in:
Arun Raghavan 2016-06-01 17:18:33 +05:30
parent c692ec3afd
commit 708b4aac91
2 changed files with 14 additions and 1 deletions

View file

@ -122,7 +122,7 @@ static const char* parse_string(const char *str, pa_json_object *obj) {
str++; /* Consume leading '"' */
while (*str != '"') {
while (*str && *str != '"') {
if (*str != '\\') {
/* We only accept ASCII printable characters. */
if (*str < 0x20 || *str > 0x7E) {