From 920bc2b993079a280286b6cfad2bdc5d1e88437b Mon Sep 17 00:00:00 2001 From: peelz Date: Wed, 19 Aug 2020 00:52:00 -0400 Subject: [PATCH] driver-hidpp10: fix segfault when committing unnamed profiles --- src/driver-hidpp10.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/driver-hidpp10.c b/src/driver-hidpp10.c index 9690b0d2..d7bc2420 100644 --- a/src/driver-hidpp10.c +++ b/src/driver-hidpp10.c @@ -573,7 +573,8 @@ hidpp10drv_commit(struct ratbag_device *device) return rc; p.enabled = profile->is_enabled; - strncpy_safe((char*)p.name, profile->name, 24); + if (profile->name != NULL) + strncpy_safe((char*)p.name, profile->name, 24); ratbag_profile_for_each_resolution(profile, resolution) { p.dpi_modes[resolution->index].xres = resolution->dpi_x;