From a30e739a144912a68adcaa9f426d600c6ecbd529 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 23 Nov 2009 13:07:56 +1000 Subject: 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 Signed-off-by: Keith Packard --- Xi/xiproperty.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Xi') 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; -- cgit v1.2.3