From: Johan Malm Date: Sun, 8 Dec 2024 17:31:23 +0000 (+0000) Subject: config/rcxml.c: fix crash in section X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=79232a61c1c77b79702a8258dc4fec6d87ec9cdf;p=proto%2Flabwc.git 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. --- 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);