From cc12755c6c29cce1b5a0791df3d21fbe08de8c9d Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sun, 14 Mar 2021 10:23:40 +0100 Subject: [PATCH] json: ignore '\0' We ignore '\0' chars as we use the string length to check for the end and the 0 chars might be inserted to parse the json in-place. --- spa/include/spa/utils/json.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spa/include/spa/utils/json.h b/spa/include/spa/utils/json.h index 91e1d2700..1ca562243 100644 --- a/spa/include/spa/utils/json.h +++ b/spa/include/spa/utils/json.h @@ -77,7 +77,7 @@ static inline int spa_json_next(struct spa_json * iter, const char **value) goto again; case __STRUCT: switch (cur) { - case '\t': case ' ': case '\r': case '\n': case ':': case '=': case ',': + case '\0': case '\t': case ' ': case '\r': case '\n': case ':': case '=': case ',': continue; case '#': iter->state = __COMMENT;