[PATCH] xserver: Fix segfault in tslib driver

David Jander david.jander at protonic.nl
Mon Apr 6 05:11:18 PDT 2009


When xserver is started with the option '-mouse tslib' the tslib-driver opens 
the default device "/dev/input/touchscreen0", but the device path-name points 
to a constant string which is later freed with xfree ---> Segfault!

Signed-off-by: David Jander <david.jander at protonic.nl>
---
diff --git a/hw/kdrive/linux/tslib.c b/hw/kdrive/linux/tslib.c
index 7ad7a88..3c76473 100644
--- a/hw/kdrive/linux/tslib.c
+++ b/hw/kdrive/linux/tslib.c
@@ -114,7 +114,7 @@ TslibEnable (KdPointerInfo *pi)
     private->raw_event_hook = NULL;
     private->raw_event_closure = NULL;
     if (!pi->path) {
-        pi->path = "/dev/input/touchscreen0";
+        pi->path = KdSaveString("/dev/input/touchscreen0");
         ErrorF("[tslib/TslibEnable] no device path given, trying %s\n", 
pi->path);
     }
     private->tsDev = ts_open(pi->path, 0);


More information about the xorg-devel mailing list