summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2022-03-25 14:44:41 -0700
committerVito Caputo <vcaputo@pengaru.com>2022-03-25 14:44:41 -0700
commite867baeae24107f211bc13908f022fd2117214d1 (patch)
tree8d6dd91ed9521326a24faa45ceb92e2d6c517789
parentee8e2327cda0fd093cb6660f98cc43b4e8f23296 (diff)
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.
-rw-r--r--src/modules/compose/compose.c3
1 files changed, 3 insertions, 0 deletions
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;
© All Rights Reserved