Commit fdc45158 authored by Peter Hutterer's avatar Peter Hutterer
Browse files

Xi: limit valuator copy to valuator array size (#59939)

mask[(MAX_VALUATORS + 7)/8] is larger than data[MAX_VALUATORS], so static
code checkers think we may be running OOB on the data array. Mask is
initialized to 0, so this should not happen, but change it anyway to shut up
code analyzer noise.

X.Org Bug 59939 <http://bugs.freedesktop.org/show_bug.cgi?id=59939

>
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
parent 48bc30c5
......@@ -1263,7 +1263,7 @@ TouchCopyValuatorData(DeviceEvent *ev, TouchPointInfoPtr ti)
{
int i;
for (i = 0; i < sizeof(ev->valuators.mask) * 8; i++)
for (i = 0; i < ARRAY_SIZE(ev->valuators.data); i++)
if (BitIsOn(ev->valuators.mask, i))
valuator_mask_set_double(ti->valuators, i, ev->valuators.data[i]);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment