[PATCH] test/xi2: fail if xi2 class type is garbage. (#25492)

Dave Airlie airlied at redhat.com
Tue Dec 22 20:58:53 PST 2009


On Wed, 2009-12-23 at 12:54 +1000, Peter Hutterer wrote:
> If the keycode range exceeds the allowable length, memory gets overwritten.
> Catch this case by making sure that only allowed class types are
> present.
> 
> X.Org Bug 25492 <http://bugs.freedesktop.org/show_bug.cgi?id=25492>
> 
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

Reviewed-by: Dave Airlie <airlied at redhat.com>
> ---
> This is the reason why the test didn't fail on x86.
> 
>  test/xi2/protocol-eventconvert.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/test/xi2/protocol-eventconvert.c b/test/xi2/protocol-eventconvert.c
> index 66686cb..f20a10a 100644
> --- a/test/xi2/protocol-eventconvert.c
> +++ b/test/xi2/protocol-eventconvert.c
> @@ -736,6 +736,9 @@ static void test_values_XIDeviceChangedEvent(DeviceChangedEvent *in,
>  
>                  }
>                  break;
> +            default:
> +                g_error("Invalid class type.\n");
> +                break;
>          }
>  
>          ptr += any->length * 4;




More information about the xorg-devel mailing list