[PATCH] xserver: Fix segfault in tslib driver

Adam Jackson ajax at nwnk.net
Mon Apr 6 10:01:45 PDT 2009


On Mon, 2009-04-06 at 14:11 +0200, David Jander wrote:
> 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);

Applied (with the KdSaveString changed to strdup), thanks!

- ajax
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://lists.x.org/archives/xorg-devel/attachments/20090406/8a2ced82/attachment.pgp 


More information about the xorg-devel mailing list