summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
authorMichal Srb <msrb@suse.com>2017-05-24 15:54:41 +0300
committerAdam Jackson <ajax@redhat.com>2017-09-25 15:34:10 -0400
commite8f6a1bb77cbd1bb30d8dc956c5fdc98e25a22aa (patch)
treece5ee2ca801c355fd7082a82d2f336458d4ce9b9 /Xi
parent21f559038c8776acc6439faadbdcab7df4300c66 (diff)
Xi: Verify all events in ProcXSendExtensionEvent.
The requirement is that events have type in range EXTENSION_EVENT_BASE..lastEvent, but it was tested only for first event of all. Signed-off-by: Michal Srb <msrb@suse.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 8caed4df36b1f802b4992edcfd282cbeeec35d9d)
Diffstat (limited to 'Xi')
-rw-r--r--Xi/sendexev.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/Xi/sendexev.c b/Xi/sendexev.c
index c9b7dde7c..365c791e8 100644
--- a/Xi/sendexev.c
+++ b/Xi/sendexev.c
@@ -117,7 +117,7 @@ SProcXSendExtensionEvent(ClientPtr client)
int
ProcXSendExtensionEvent(ClientPtr client)
{
- int ret;
+ int ret, i;
DeviceIntPtr dev;
xEvent *first;
XEventClass *list;
@@ -141,10 +141,12 @@ ProcXSendExtensionEvent(ClientPtr client)
/* The client's event type must be one defined by an extension. */
first = ((xEvent *) &stuff[1]);
- if (!((EXTENSION_EVENT_BASE <= first->u.u.type) &&
- (first->u.u.type < lastEvent))) {
- client->errorValue = first->u.u.type;
- return BadValue;
+ for (i = 0; i < stuff->num_events; i++) {
+ if (!((EXTENSION_EVENT_BASE <= first[i].u.u.type) &&
+ (first[i].u.u.type < lastEvent))) {
+ client->errorValue = first[i].u.u.type;
+ return BadValue;
+ }
}
list = (XEventClass *) (first + stuff->num_events);