From b396ba36978229baf8b45dd64936ba76b1df15bc Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 12 Sep 2024 09:40:50 +1000 Subject: [PATCH] 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: --- src/xf86libinput.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/xf86libinput.c b/src/xf86libinput.c index a2ecdad..9fe83cd 100644 --- a/src/xf86libinput.c +++ b/src/xf86libinput.c @@ -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];