summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2013-01-29 11:01:29 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2013-02-08 13:47:23 +1000
commitfdc451588816c4bc798d54e56316530e9066be80 (patch)
tree59766978602442bb175fa4ba255e5f5e749b178d /Xi
parent48bc30c5413a1be0039fa77affcbbb4fe677479f (diff)
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 <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'Xi')
-rw-r--r--Xi/exevents.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c
index 74f3610cc..609b1268f 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -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]);
}