From 5d24ac3e6d634d69f2eb71e82d49ad0dccaf623e Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 17 Apr 2026 15:10:17 +1000 Subject: [PATCH] Xi: fail if we can't assign device names During extension init this makes sense, failing to assign a name to a new device is more controversial but none of the paths handle this situation correctly right now so we're just as likely to introduce an exploit if the name remains NULL. Co-Authored-by: Claude Code Part-of: --- Xi/extinit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Xi/extinit.c b/Xi/extinit.c index 4dad0b5e9..c2306669c 100644 --- a/Xi/extinit.c +++ b/Xi/extinit.c @@ -1207,7 +1207,7 @@ void AssignTypeAndName(DeviceIntPtr dev, Atom type, const char *name) { dev->xinput_type = type; - dev->name = strdup(name); + dev->name = XNFstrdup(name); } /*********************************************************************** @@ -1356,9 +1356,9 @@ XInputExtensionInit(void) memset(&xi_all_devices, 0, sizeof(xi_all_devices)); memset(&xi_all_master_devices, 0, sizeof(xi_all_master_devices)); xi_all_devices.id = XIAllDevices; - xi_all_devices.name = strdup("XIAllDevices"); + xi_all_devices.name = XNFstrdup("XIAllDevices"); xi_all_master_devices.id = XIAllMasterDevices; - xi_all_master_devices.name = strdup("XIAllMasterDevices"); + xi_all_master_devices.name = XNFstrdup("XIAllMasterDevices"); inputInfo.all_devices = &xi_all_devices; inputInfo.all_master_devices = &xi_all_master_devices;