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>
This commit is contained in:
parent
19f7c15e20
commit
a30e739a14
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user