From 7aba2514b28de455ee3daef5f84424f4376a5d37 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 4 Jan 2024 10:31:51 +1000 Subject: [PATCH] dix: don't allow for devices with 0 axes This just makes the existing behavior explicit, previously we relied on a malloc(numAxes * ...) to return NULL to error out. --- dix/devices.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dix/devices.c b/dix/devices.c index 3f3224d62..bdbe2dc73 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -1335,6 +1335,7 @@ InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, Atom *labels, ValuatorClassPtr valc; BUG_RETURN_VAL(dev == NULL, FALSE); + BUG_RETURN_VAL(numAxes == 0, FALSE); if (numAxes > MAX_VALUATORS) { LogMessage(X_WARNING,