mirror of
https://github.com/labwc/labwc.git
synced 2025-11-01 22:58:47 -04:00
config/rcxml.c: fix crash in <touch> section
...when options are specified as elements leading to hitting the assert()
in xstrdup().
Reproduce by using this rc.xml:
```
<?xml version="1.0"?>
<labwc_config>
<touch>
<deviceName>foo</deviceName>
<mapToOutput>bar</mapToOutput>
</touch>
</labwc_config>
```
It is likely that <touch> was only tested with options as attributes.
This commit is contained in:
parent
5e422a0bc2
commit
79232a61c1
1 changed files with 8 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue