WPrefs: fix possible crash when saving mouse modifier (Coverity #50098)
commitdc2a991e219fa5c06a1294cac256fa44e7c9206a
authorChristophe CURIS <christophe.curis@free.fr>
Sat, 31 May 2014 17:58:41 +0000 (31 19:58 +0200)
committerCarlos R. Mafra <crmafra@gmail.com>
Sun, 1 Jun 2014 19:35:06 +0000 (1 20:35 +0100)
treec305d2cc1281931bca761c737571038bfd6f57e4
parent4b7bb5bc5c141e395551f6538a782c12ae3b6dac
WPrefs: fix possible crash when saving mouse modifier (Coverity #50098)

As pointed by Coverity, there is a possible NULL pointer dereference in the
code that extracts the selected modifier (from a popup button list).

The code assumes that there is always a space between the core name of the
modifier (which is used for saving) and the more user friendly name. This
is true if the list could be successfully generated in fillModifierPopUp,
but it may not be the case if that function has to fall-back to the
default list (XGetModifierMaping failure).

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
WPrefs.app/MouseSettings.c