Replace unbounded sprintf() with the safer snprintf(). While the
current code works correctly, snprintf() is safer and follows secure
coding best practices.
No functional changes.
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
[ rjw: Subject tweaks ]
Link: https://patch.msgid.link/20260223073245.321298-2-thorsten.blum@linux.dev
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
goto free_mem;
dev->id = result;
- sprintf(dev->name, "cdev%d", dev->id);
+ snprintf(dev->name, sizeof(dev->name), "cdev%d", dev->id);
result =
sysfs_create_link(&tz->device.kobj, &cdev->device.kobj, dev->name);
if (result)