Prevent theoretical null-pointer dereference

Cannot happen since we don't enter this function if the atom isn't one
of the three checked above but the static analyzer doesn't know that.

Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/-/merge_requests/60>
This commit is contained in:
Peter Hutterer
2024-09-12 09:40:50 +10:00
committed by Marge Bot
parent 0bcb60e744
commit b396ba3697

View File

@@ -4678,6 +4678,8 @@ LibinputSetPropertyAccelPoints(DeviceIntPtr dev,
accel_points = &driver_data->options.accel_points_motion;
else if (atom == prop_accel_points_scroll)
accel_points = &driver_data->options.accel_points_scroll;
else
return BadValue;
for (size_t idx = 0; idx < val->size; idx++)
accel_points->points[idx] = data[idx];