mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
platform/x86: dell_rbu: use strscpy in image_type_write
strcpy() has been deprecated [1] because it performs no bounds checking on the destination buffer, which can lead to buffer overflows. While the current code works correctly, replace strcpy() with the safer strscpy() to follow secure coding best practices. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy [1] Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Link: https://patch.msgid.link/20260410091633.2822-6-thorsten.blum@linux.dev Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
This commit is contained in:
parent
9f82bbcac0
commit
0b9f109c31
|
|
@ -562,9 +562,9 @@ static ssize_t image_type_write(struct file *filp, struct kobject *kobj,
|
|||
buffer[count] = '\0';
|
||||
|
||||
if (strstr(buffer, "mono"))
|
||||
strcpy(image_type, "mono");
|
||||
strscpy(image_type, "mono");
|
||||
else if (strstr(buffer, "packet"))
|
||||
strcpy(image_type, "packet");
|
||||
strscpy(image_type, "packet");
|
||||
else if (strstr(buffer, "init")) {
|
||||
/*
|
||||
* If due to the user error the driver gets in a bad
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user