summaryrefslogtreecommitdiff
path: root/Xi/xiproperty.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-11-23 13:07:56 +1000
committerKeith Packard <keithp@keithp.com>2009-11-22 19:42:13 -0800
commita30e739a144912a68adcaa9f426d600c6ecbd529 (patch)
treee034bdd8474f6a34b2dd98a93c8caffb1b05058e /Xi/xiproperty.c
parent19f7c15e2008dab3c46ba3e14dfa353d01c74f72 (diff)
Xi: don't crash when deleting invalid device properties.
Deleting a property that was not set on a device leads to a null-pointer reference. The protocol allows deleting those properties - it has to be a noop. Reproducible: xinput --set-prop "My device" --type=int --format=8 "my property" 1 xinput --delete-prop "My other device" "my property" Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'Xi/xiproperty.c')
-rw-r--r--Xi/xiproperty.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c
index 024dc444b..482185703 100644
--- a/Xi/xiproperty.c
+++ b/Xi/xiproperty.c
@@ -643,6 +643,9 @@ XIDeleteDeviceProperty (DeviceIntPtr device, Atom property, Bool fromClient)
if (prop->propertyName == property)
break;
+ if (!prop)
+ return Success;
+
if (fromClient && !prop->deletable)
return BadAccess;