From e867baeae24107f211bc13908f022fd2117214d1 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Fri, 25 Mar 2022 14:44:41 -0700 Subject: modules/compose: -EINVAL on empty layers setting This resulted in a NULL ptr deref, simply treating as invalid since what's the point of handling a composition devoid of any layers - it's probably a mistake. --- src/modules/compose/compose.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/modules/compose') diff --git a/src/modules/compose/compose.c b/src/modules/compose/compose.c index 0f6b8fc..9be4c0c 100644 --- a/src/modules/compose/compose.c +++ b/src/modules/compose/compose.c @@ -141,6 +141,9 @@ static int compose_setup(const til_settings_t *settings, til_setting_t **res_set return -ENOMEM; layer = strtok(toklayers, ":"); + if (!layer) + return -EINVAL; + do { char **new; size_t i; -- cgit v1.2.3