chiark / gitweb /
Don't segfault when no icons are available.
authorAsher Gordon <AsDaGo@posteo.net>
Tue, 24 Dec 2019 05:44:30 +0000 (00:44 -0500)
committerSimon Tatham <anakin@pobox.com>
Wed, 25 Dec 2019 06:28:52 +0000 (06:28 +0000)
commitce69911077ce1399ae3626c9f66737c4586db18a
treeb89cb458b41d540f635cbfe36dac9b7d86d96fe8
parent1c0c49dd5cd8df6ae87f7be5371be84589fa2662
Don't segfault when no icons are available.

When no icons are available, n_xpm_icons will be 0, and
menu_about_event() will try to access xpm_icons[n_xpm_icons-1]. Since
n_xpm_icons is 0, this becomes xpm_icons[-1] which is an invalid
value, causing a segfault.

Instead, check if n_xpm_icons is 0, and if so, don't pass any icon to
gtk_show_about_dialog().
gtk.c