On Tue, Sep 25, 2012 at 10:28:06AM -0700, Jason Gerecke wrote:
> Commit cff344b1 modified the null-handling of wcmCheckSource, such
> that the wrong result will be returned if either/both fsource and
> psource are null.
>
> Signed-off-by: Jason Gerecke <[email protected]>
> ---
> src/wcmValidateDevice.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c
> index a296984..7551d75 100644
> --- a/src/wcmValidateDevice.c
> +++ b/src/wcmValidateDevice.c
> @@ -49,13 +49,17 @@ static Bool wcmCheckSource(InputInfoPtr pInfo, dev_t
> min_maj)
> char* fsource = xf86CheckStrOption(pInfo->options,
> "_source", NULL);
> char* psource = xf86CheckStrOption(pDevices->options,
> "_source", NULL);
>
> + if (!fsource)
> + fsource = "";
> + if (!psource)
> + psource = "";
> +
Instead just use the 'deflt' argument to xf86CheckStrOption
char* psource = xf86CheckStrOption(pDevices->options, "_source", "");
With that change, Reviewed-by: Peter Hutterer <[email protected]>
Cheers,
Peter
> if (pCommon->min_maj &&
> pCommon->min_maj == min_maj)
> {
> /* only add the new tool if the matching
> major/minor
> * was from the same source */
> - if ((!fsource && !psource) ||
> - (fsource && psource && strcmp(fsource,
> psource)))
> + if (strcmp(fsource, psource))
> {
> match = 1;
> break;
> --
> 1.7.12
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel