All of lore.kernel.org
 help / color / mirror / Atom feed
* b43/leds: Ensure NUL-termination of LED name string
@ 2018-07-31 19:14 Michael Büsch
  2018-08-09 15:28 ` Kalle Valo
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Büsch @ 2018-07-31 19:14 UTC (permalink / raw)
  To: Kalle Valo; +Cc: Larry Finger, Rafał Miłecki, linux-wireless, b43-dev

[-- Attachment #1: Type: text/plain, Size: 869 bytes --]

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
---
 drivers/net/wireless/broadcom/b43/leds.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/broadcom/b43/leds.c b/drivers/net/wireless/broadcom/b43/leds.c
index cb987c2ecc6b..87131f663292 100644
--- a/drivers/net/wireless/broadcom/b43/leds.c
+++ b/drivers/net/wireless/broadcom/b43/leds.c
@@ -131,7 +131,7 @@ static int b43_register_led(struct b43_wldev *dev, struct b43_led *led,
 	led->wl = dev->wl;
 	led->index = led_index;
 	led->activelow = activelow;
-	strncpy(led->name, name, sizeof(led->name));
+	strlcpy(led->name, name, sizeof(led->name));
 	atomic_set(&led->state, 0);
 
 	led->led_dev.name = led->name;

-- 
Michael

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-08-10 17:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-31 19:14 b43/leds: Ensure NUL-termination of LED name string Michael Büsch
2018-08-09 15:28 ` Kalle Valo
2018-08-09 16:02   ` Jonas Gorski
2018-08-09 16:15     ` Kalle Valo
2018-08-09 16:41       ` Jonas Gorski
2018-08-09 17:01         ` Kalle Valo
2018-08-10  8:31           ` Jonas Gorski
2018-08-10 14:30             ` Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.