mirror of
https://github.com/X11Libre/xf86-input-synaptics.git
synced 2026-03-24 01:34:04 +00:00
Avoid out-of-bounds access by running num_active_touches < 0 (#49439)
If a touch is active during driver init, the slot will be set to
SLOTSTATE_CLOSE when it finishes. That could decrease num_active_touches to
less than 0, causing out-of-bounds access.
X.Org Bug 49439 <http://bugs.freedesktop.org/show_bug.cgi?id=49439>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
(cherry picked from commit 77d766b1d5)
This commit is contained in:
@@ -3128,7 +3128,9 @@ UpdateTouchState(InputInfoPtr pInfo, struct SynapticsHwState *hw)
|
||||
priv->open_slots[j] = priv->open_slots[j + 1];
|
||||
}
|
||||
|
||||
priv->num_active_touches--;
|
||||
BUG_WARN(priv->num_active_touches == 0);
|
||||
if (priv->num_active_touches > 0)
|
||||
priv->num_active_touches--;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user