mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Updating a vulnerable use of strcpy.
@ 2024-06-30 12:48 Muhammad Qasim Abdul Majeed
  0 siblings, 0 replies; only message in thread
From: Muhammad Qasim Abdul Majeed @ 2024-06-30 12:48 UTC (permalink / raw)
  To: rafael, lenb, linux-acpi, linux-kernel; +Cc: Muhammad Qasim Abdul Majeed

Replacing strcpy with strscpy with memory bound.

Signed-off-by: Muhammad Qasim Abdul Majeed <qasim.majeed20@gmail.com>
---
 drivers/acpi/acpi_video.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c
index 1fda30388297..700f0e8fdba2 100644
--- a/drivers/acpi/acpi_video.c
+++ b/drivers/acpi/acpi_video.c
@@ -1128,8 +1128,8 @@ static int acpi_video_bus_get_one_device(struct acpi_device *device, void *arg)
 		return -ENOMEM;
 	}
 
-	strcpy(acpi_device_name(device), ACPI_VIDEO_DEVICE_NAME);
-	strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS);
+	strscpy(acpi_device_name(device), ACPI_VIDEO_DEVICE_NAME, strlen(ACPI_VIDEO_DEVICE_NAME));
+	strscpy(acpi_device_class(device), ACPI_VIDEO_CLASS, strlen(ACPI_VIDEO_CLASS));
 
 	data->device_id = device_id;
 	data->video = video;
-- 
2.34.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-06-30 12:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-30 12:48 [PATCH] Updating a vulnerable use of strcpy Muhammad Qasim Abdul Majeed

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®