Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

b43legacy/leds: Ensure NUL-termination of LED name string

strncpy might not NUL-terminate the string, if the name equals the buffer size.
Use strlcpy instead.

Signed-off-by: Michael Buesch <m@bues.ch>
Cc: stable@vger.kernel.org
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

authored by

Michael Büsch and committed by
Kalle Valo
4d77a89e 2aa650d1

+1 -1
+1 -1
drivers/net/wireless/broadcom/b43legacy/leds.c
··· 101 101 led->dev = dev; 102 102 led->index = led_index; 103 103 led->activelow = activelow; 104 - strncpy(led->name, name, sizeof(led->name)); 104 + strlcpy(led->name, name, sizeof(led->name)); 105 105 106 106 led->led_dev.name = led->name; 107 107 led->led_dev.default_trigger = default_trigger;