mirror of
https://github.com/X11Libre/xf86-input-synaptics.git
synced 2026-03-24 01:34:04 +00:00
Don't allow for scroll distances of 0 (#49965)
It'll either hang the server or blow up with divisions by 0, whichever one
comes first.
X.Org Bug 49965 <http://bugs.freedesktop.org/show_bug.cgi?id=49965>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
(cherry picked from commit 6d47d334d8)
This commit is contained in:
@@ -519,6 +519,9 @@ SetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
|
||||
return BadMatch;
|
||||
|
||||
dist = (INT32 *) prop->data;
|
||||
if (dist[0] == 0 || dist[1] == 0)
|
||||
return BadValue;
|
||||
|
||||
if (para->scroll_dist_vert != dist[0]) {
|
||||
para->scroll_dist_vert = dist[0];
|
||||
#ifdef HAVE_SMOOTH_SCROLL
|
||||
@@ -715,6 +718,9 @@ SetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
|
||||
return BadMatch;
|
||||
|
||||
circdist = *(float *) prop->data;
|
||||
if (circdist == 0)
|
||||
return BadValue;
|
||||
|
||||
para->scroll_dist_circ = circdist;
|
||||
}
|
||||
else if (property == prop_circscroll_trigger) {
|
||||
|
||||
Reference in New Issue
Block a user