From 1ea053f57bf21ad743cf17fda47b1b5311750a36 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 15 Jan 2009 09:16:55 +1000 Subject: [PATCH] Xi: Force a CopyKeyClass on the VCK when posting a key event through the VCP Some devices that have both axes and keys may be attached to the VCP. Such a device will segfault the server when posting a key event since master->key doesn't exist. Force the CopyKeyClass on the VCK if that happens. Reported by pcpa. --- Xi/exevents.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/Xi/exevents.c b/Xi/exevents.c index 083bb2f..b6f0880 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -197,6 +197,9 @@ CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master) if (device == master) return; + if (!master->key) /* Posting a key event through the VCP? */ + master = GetPairedDevice(master); + dk = device->key; mk = master->key; -- 1.6.0.6