From a22f0f5dd020958c7a61282e067479add99a0a5a Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Fri, 24 Dec 2021 02:49:56 +0100 Subject: json: Update parser (jsmn) to verify the length of the input data This way the string doesn't have to be 0-terminated. --- src/jplist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/jplist.c') diff --git a/src/jplist.c b/src/jplist.c index fbc963e..889ce30 100644 --- a/src/jplist.c +++ b/src/jplist.c @@ -661,7 +661,7 @@ PLIST_API int plist_from_json(const char *json, uint32_t length, plist_t * plist } tokens = newtokens; - r = jsmn_parse(&parser, json, tokens, maxtoks); + r = jsmn_parse(&parser, json, length, tokens, maxtoks); if (r == JSMN_ERROR_NOMEM) { maxtoks+=16; continue; -- cgit v1.1-32-gdbae