From 79232a61c1c77b79702a8258dc4fec6d87ec9cdf Mon Sep 17 00:00:00 2001 From: Johan Malm Date: Sun, 8 Dec 2024 17:31:23 +0000 Subject: [PATCH] config/rcxml.c: fix crash in section ...when options are specified as elements leading to hitting the assert() in xstrdup(). Reproduce by using this rc.xml: ``` foo bar ``` It is likely that was only tested with options as attributes. --- src/config/rcxml.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/config/rcxml.c b/src/config/rcxml.c index eeb9d681..cb064fc0 100644 --- a/src/config/rcxml.c +++ b/src/config/rcxml.c @@ -646,7 +646,14 @@ fill_touch(char *nodename, char *content) if (!strcasecmp(nodename, "touch")) { current_touch = znew(*current_touch); wl_list_append(&rc.touch_configs, ¤t_touch->link); - } else if (!strcasecmp(nodename, "deviceName.touch")) { + return; + } + + if (!content) { + return; + } + + if (!strcasecmp(nodename, "deviceName.touch")) { xstrdup_replace(current_touch->device_name, content); } else if (!strcasecmp(nodename, "mapToOutput.touch")) { xstrdup_replace(current_touch->output_name, content);