Re: [Linuxwacom-devel] [PATCH] Fix off-by-one error in xsetwacom's button handling

2012-04-03 Thread Chris Bagwell
Seems reasonable a zero based offset should check >= nitems value and
aligns with similar check in get_actions().

Reviewed-by: Chris Bagwell 

On Tue, Apr 3, 2012 at 5:00 PM, Jason Gerecke  wrote:

>
> Signed-off-by: Jason Gerecke 
> ---
>  tools/xsetwacom.c |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/xsetwacom.c b/tools/xsetwacom.c
> index 7cf0d05..28332d1 100644
> --- a/tools/xsetwacom.c
> +++ b/tools/xsetwacom.c
> @@ -1244,7 +1244,7 @@ static void special_map_property(Display *dpy,
> XDevice *dev, Atom btnact_prop, i
>AnyPropertyType, &type, &format,
> &btnact_nitems,
>&bytes_after, (unsigned
> char**)&btnact_data);
>
> -   if (offset > btnact_nitems)
> +   if (offset >= btnact_nitems)
>{
>fprintf(stderr, "Invalid offset into %s property.\n",
> XGetAtomName(dpy, btnact_prop));
>goto out;
> --
> 1.7.9.5
>
>
>
> --
> Better than sec? Nothing is better than sec when it comes to
> monitoring Big Data applications. Try Boundary one-second
> resolution app monitoring today. Free.
> http://p.sf.net/sfu/Boundary-dev2dev
> ___
> Linuxwacom-devel mailing list
> Linuxwacom-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel
>
--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH] Fix off-by-one error in xsetwacom's button handling

2012-04-03 Thread Jason Gerecke

Signed-off-by: Jason Gerecke 
---
 tools/xsetwacom.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/xsetwacom.c b/tools/xsetwacom.c
index 7cf0d05..28332d1 100644
--- a/tools/xsetwacom.c
+++ b/tools/xsetwacom.c
@@ -1244,7 +1244,7 @@ static void special_map_property(Display *dpy, XDevice 
*dev, Atom btnact_prop, i
AnyPropertyType, &type, &format, &btnact_nitems,
&bytes_after, (unsigned char**)&btnact_data);
 
-   if (offset > btnact_nitems)
+   if (offset >= btnact_nitems)
{
fprintf(stderr, "Invalid offset into %s property.\n", 
XGetAtomName(dpy, btnact_prop));
goto out;
-- 
1.7.9.5


--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel