sway

i3-compatible Wayland compositor
git clone https://git.awy.one/sway
Log | Files | Refs | README | LICENSE

commit d64e8ba9469f4fa0ff693a22c88c1afa687c4c6c
parent acdb4ed7a32a7cefd4ac37190ba65d33d752bee0
Author: Stephan Hilb <stephan@ecshi.net>
Date:   Wed, 13 Mar 2019 21:32:02 +0100

swaybar: fix loading of malformed icon theme

If the icon index.theme contained a key-value pair without a preceding
group header, entry_handler() would be called with a zero pointer and
lead to a segfault.
Set the error flag and break on such malformed files.

Diffstat:
Mswaybar/tray/icon.c | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/swaybar/tray/icon.c b/swaybar/tray/icon.c @@ -243,6 +243,10 @@ static struct icon_theme *read_theme_file(char *basedir, char *theme_name) { free(group); group = strdup(&line[1]); } else { // key-value pair + if (!group) { + error = true; + break; + } // check well-formed int eok = 0; for (; isalnum(line[eok]) || line[eok] == '-'; ++eok) {} // TODO locale?