summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2022-11-29 13:24:00 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2022-12-14 11:30:14 +1000
commit6eaf8b43429c6bfd8c8005009d89899b4d0fa884 (patch)
tree907c4ea51b2c5a13e7e60a47ab66652e00e45059
parent2a81326e75f739fbdff66cfbe4a3d5ce9c5de014 (diff)
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 b8a84cb0f2807b07ab70ca9915fcdee21301b8ca)
-rw-r--r--Xi/xiproperty.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c
index a36f7d61d..68c362c62 100644
--- a/Xi/xiproperty.c
+++ b/Xi/xiproperty.c
@@ -902,6 +902,8 @@ ProcXChangeDeviceProperty(ClientPtr client)
rc = check_change_property(client, stuff->property, stuff->type,
stuff->format, stuff->mode, stuff->nUnits);
+ if (rc != Success)
+ return rc;
len = stuff->nUnits;
if (len > (bytes_to_int32(0xffffffff - sizeof(xChangeDevicePropertyReq))))
@@ -1141,6 +1143,9 @@ ProcXIChangeProperty(ClientPtr client)
rc = check_change_property(client, stuff->property, stuff->type,
stuff->format, stuff->mode, stuff->num_items);
+ if (rc != Success)
+ return rc;
+
len = stuff->num_items;
if (len > bytes_to_int32(0xffffffff - sizeof(xXIChangePropertyReq)))
return BadLength;