diff options
author | Michael Büsch <m@bues.ch> | 2018-07-31 21:14:04 +0200 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2018-08-09 18:22:33 +0300 |
commit | 2aa650d1950fce94f696ebd7db30b8830c2c946f (patch) | |
tree | 176d29fee91ef2617a6c01d93da9854c1f3fad3b /drivers/net/wireless | |
parent | c7743c428111912fffceb38b860024f7e33b3e3c (diff) | |
download | linux-2aa650d1950fce94f696ebd7db30b8830c2c946f.tar.bz2 |
b43/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>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/broadcom/b43/leds.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |