On Wed, Oct 24, 2012 at 12:20 AM, Peter Hutterer
<peter.hutte...@who-t.net> wrote:
> An xorg.conf InputDevice section that does not have Option Type set is
> invalid. Skip the type assignment and return, triggering an error about an
> invalid type lateron.
>
> Fixes crash triggered as of xf86-input-wacom-0.17.0-8-g0debde6 by having an
> InputDevice section like this:
>
> Section "InputDevice"
>     Identifier "--device--"
>     Driver "wacom"
>     Option "CorePointer" "on"
> EndSection
>
> This would lead to the device being assigned a type and assumed to be for
> hotplugging. Later, when the device attributes are duplicated during
> QueueHotplug, asprintf() tries to duplicate attr->product, which is always
> NULL for xorg.conf devices.
>
> Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>
> ---
> Full config for the lazy :)
>
> Section "ServerLayout"
>     Identifier "Dummy layout"
>     Option "AutoAddDevices" "off"
>     Screen 0 "dummy screen" 0 0
>     InputDevice "--device--"
> EndSection
>
> Section "ServerFlags"
>      Option "Log" "flush"
> EndSection
>
> Section "Device"
>     Identifier "dummy"
>     Driver "dummy"
> EndSection
>
> Section "Screen"
>     Identifier "dummy screen"
>     Device "dummy"
> EndSection
>
> Section "InputDevice"
>     Identifier "--device--"
>     Driver "wacom"
>     Option "CorePointer" "on"
> EndSection
>
> Running 9f896f4800593c7fa232e40fd934b7f51d0dde6d (0.17.99.1) with that config
> file below crashes the server immediately. git bisect pointed to
> xf86-input-wacom-0.17.0-8-g0debde6, but that seems to just trigger the bug,
> it's not the direct cause of it.
>
>  src/wcmValidateDevice.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c
> index 658092b..bc5ad44 100644
> --- a/src/wcmValidateDevice.c
> +++ b/src/wcmValidateDevice.c
> @@ -578,6 +578,9 @@ int wcmNeedAutoHotplug(InputInfoPtr pInfo, const char 
> **type)
>         if (*type) /* type specified, don't hotplug */
>                 return 0;
>
> +       if (!source) /* xorg.conf device, don't auto-pick type */
> +               return 0;
> +
>         if (source && strcmp(source, "server/hal") && strcmp(source, 
> "server/udev"))
>                 return 0;
>
> --
> 1.7.11.7
>
>

Reviewed-by: Jason Gerecke <killert...@gmail.com>

Jason

---
When you're rife with devastation / There's a simple explanation:
You're a toymaker's creation / Trapped inside a crystal ball.
And whichever way he tilts it / Know that we must be resilient
We won't let them break our spirits / As we sing our silly song.

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to