Xi: return an error from XI property changes if verification failed

Both ProcXChangeDeviceProperty and ProcXIChangeProperty checked the
property for validity but didn't actually return the potential error.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Olivier Fourdan <ofourdan@redhat.com>
(cherry picked from commit b8a84cb0f2)
This commit is contained in:
Peter Hutterer 2022-11-29 13:24:00 +10:00
parent d6c7de9ead
commit 40f431de8a

View File

@ -902,6 +902,8 @@ ProcXChangeDeviceProperty(ClientPtr client)
rc = check_change_property(client, stuff->property, stuff->type, rc = check_change_property(client, stuff->property, stuff->type,
stuff->format, stuff->mode, stuff->nUnits); stuff->format, stuff->mode, stuff->nUnits);
if (rc != Success)
return rc;
len = stuff->nUnits; len = stuff->nUnits;
if (len > (bytes_to_int32(0xffffffff - sizeof(xChangeDevicePropertyReq)))) if (len > (bytes_to_int32(0xffffffff - sizeof(xChangeDevicePropertyReq))))
@ -1141,6 +1143,9 @@ ProcXIChangeProperty(ClientPtr client)
rc = check_change_property(client, stuff->property, stuff->type, rc = check_change_property(client, stuff->property, stuff->type,
stuff->format, stuff->mode, stuff->num_items); stuff->format, stuff->mode, stuff->num_items);
if (rc != Success)
return rc;
len = stuff->num_items; len = stuff->num_items;
if (len > bytes_to_int32(0xffffffff - sizeof(xXIChangePropertyReq))) if (len > bytes_to_int32(0xffffffff - sizeof(xXIChangePropertyReq)))
return BadLength; return BadLength;