From afda43984e84b6cf04bc72d5fea6551e5bd83c29 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Fri, 15 Dec 2023 23:16:47 -0500 Subject: dont allow empty compound key names --- src/json/read.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/json') diff --git a/src/json/read.c b/src/json/read.c index 9b75597..b95bc13 100644 --- a/src/json/read.c +++ b/src/json/read.c @@ -524,6 +524,12 @@ static bool json_read_compound(tagdata_t *data, const stream_t *stream) { char *name = next.data.string.data; int name_len = next.data.string.len; + + if (name_len < 1) { + free(tags); + free(name); + return false; + } if (json_next_token(&next, stream) == false || next.type != TOK_COLON) { free(tags); -- cgit v1.2.3-freya