diff options
author | Jason Gerecke <killertofu@gmail.com> | 2012-12-17 16:56:06 -0800 |
---|---|---|
committer | Jason Gerecke <killertofu@gmail.com> | 2013-01-23 11:09:02 -0800 |
commit | 33cccd3fa4e5185857b2248b56509a97ed19df84 (patch) | |
tree | fe0f8f543b57cac55e5aff1284cfe48270e92ad1 | |
parent | 2d38dac523145e3157a3b5fc200f13254f56219c (diff) | |
download | xf86-input-wacom-33cccd3fa4e5185857b2248b56509a97ed19df84.tar.gz |
Have wcmFindActionHandler properly handle wcmFindProp error
If wcmFindProp cannot find the given property, it will return a
negative error code. At the moment, this is taken as the success
condition(!?) for the strip_actions case... Aside from being
wrong, this has the potential to cause some nasty memory corruption.
Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | src/wcmXCommand.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wcmXCommand.c b/src/wcmXCommand.c index 6dd6c58..713836c 100644 --- a/src/wcmXCommand.c +++ b/src/wcmXCommand.c @@ -356,7 +356,7 @@ static void wcmFindActionHandler(WacomDevicePtr priv, Atom property, Atom **hand } offset = wcmFindProp(property, priv->strip_actions, ARRAY_SIZE(priv->strip_actions)); - if (offset < 0) + if (offset >= 0) { *handler = &priv->strip_actions[offset]; *action = &priv->strip_keys[offset]; |