From 90e6d93cf9bfafd63d7849dc16ce194d6f9c9d5f Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 23 Dec 2009 12:54:14 +1000 Subject: test/xi2: fail if xi2 class type is garbage. (#25492) If the keycode range exceeds the allowable length, memory gets overwritten. Catch this case by making sure that only allowed class types are present. X.Org Bug 25492 Signed-off-by: Peter Hutterer Reviewed-by: Dave Airlie Signed-off-by: Keith Packard --- test/xi2/protocol-eventconvert.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test') diff --git a/test/xi2/protocol-eventconvert.c b/test/xi2/protocol-eventconvert.c index 66686cb1c..f20a10a57 100644 --- a/test/xi2/protocol-eventconvert.c +++ b/test/xi2/protocol-eventconvert.c @@ -736,6 +736,9 @@ static void test_values_XIDeviceChangedEvent(DeviceChangedEvent *in, } break; + default: + g_error("Invalid class type.\n"); + break; } ptr += any->length * 4; -- cgit v1.2.3