On Fri, Apr 16, 2010 at 8:42 AM, Tiago Vignatti
<[email protected]> wrote:
> Both dev and dev->button are already used before their checking were being
> performed. So check on the beginning.
>
> Signed-off-by: Tiago Vignatti <[email protected]>
> ---
>  Xi/xiquerydevice.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/Xi/xiquerydevice.c b/Xi/xiquerydevice.c
> index 435868d..a4bbc2e 100644
> --- a/Xi/xiquerydevice.c
> +++ b/Xi/xiquerydevice.c
> @@ -247,6 +247,9 @@ ListButtonInfo(DeviceIntPtr dev, xXIButtonInfo* info, 
> Bool reportState)
>     int mask_len;
>     int i;
>
> +    if (!dev || !dev->button)
> +       return BadValue;

This function returns "Number of bytes written into info". So, this
will just make it return 2 and the caller will carry on normally. It
should probably return 0 so the caller thinks it can't write any bytes
here. Otherwise, looks good.

--
Dan
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to