summaryrefslogtreecommitdiff
path: root/patches/source/xorg-server/patch/xorg-server/xorg-server.CVE-2017-10971.diff
blob: 25f09ee1a1c51b04104942701debdb918576c27f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--- ./Xi/sendexev.c.orig	2010-04-30 04:26:35.000000000 -0500
+++ ./Xi/sendexev.c	2017-08-15 14:58:25.709950954 -0500
@@ -95,9 +95,17 @@
 
     eventP = (xEvent *) & stuff[1];
     for (i = 0; i < stuff->num_events; i++, eventP++) {
+        if (eventP->u.u.type == GenericEvent) {
+            client->errorValue = eventP->u.u.type;
+            return BadValue;
+        }
+
 	proc = EventSwapVector[eventP->u.u.type & 0177];
-	if (proc == NotImplemented)	/* no swapping proc; invalid event type? */
+        /* no swapping proc; invalid event type? */
+        if (proc == NotImplemented) {
+            client->errorValue = eventP->u.u.type;
 	    return (BadValue);
+	}
 	(*proc) (eventP, &eventT);
 	*eventP = eventT;
     }