Em Fri, 2012-04-20 às 14:49 +1000, Peter Hutterer escreveu:
> Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>
> ---
> New patch, I didn't want to jump through the rebase hoops (indentation patch
> is in between the original and this one).

Reviewed-By: Bastien Nocera <had...@hadess.net>

>  libwacom/libwacom.c |    8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c
> index 632bece..ccd7789 100644
> --- a/libwacom/libwacom.c
> +++ b/libwacom/libwacom.c
> @@ -596,6 +596,8 @@ libwacom_update_match(WacomDevice *device, WacomBusType 
> bus, int vendor_id, int
>  
>  int libwacom_get_vendor_id(WacomDevice *device)
>  {
> +     g_return_val_if_fail(device->match >= 0, -1);
> +     g_return_val_if_fail(device->match < device->nmatches, -1);
>       return device->matches[device->match]->vendor_id;
>  }
>  
> @@ -606,11 +608,15 @@ const char* libwacom_get_name(WacomDevice *device)
>  
>  int libwacom_get_product_id(WacomDevice *device)
>  {
> +     g_return_val_if_fail(device->match >= 0, -1);
> +     g_return_val_if_fail(device->match < device->nmatches, -1);
>       return device->matches[device->match]->product_id;
>  }
>  
>  const char* libwacom_get_match(WacomDevice *device)
>  {
> +     g_return_val_if_fail(device->match >= 0, NULL);
> +     g_return_val_if_fail(device->match < device->nmatches, NULL);
>       return device->matches[device->match]->match;
>  }
>  
> @@ -697,6 +703,8 @@ int libwacom_is_reversible(WacomDevice *device)
>  
>  WacomBusType libwacom_get_bustype(WacomDevice *device)
>  {
> +     g_return_val_if_fail(device->match >= 0, -1);
> +     g_return_val_if_fail(device->match < device->nmatches, -1);
>       return device->matches[device->match]->bus;
>  }
>  



------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to