summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Copeland <me@bobcopeland.com>2014-08-22 13:18:01 (GMT)
committerJohn W. Linville <linville@tuxdriver.com>2014-08-28 18:41:56 (GMT)
commitdaf9669bea30aa22d44671e0d9ce90234579e1db (patch)
tree24db392a0762b25fa9bb836c12b53b9cdacdcabf
parente6938ea4d56cca1dc7984428d3af79b27ce1db51 (diff)
downloadlinux-daf9669bea30aa22d44671e0d9ce90234579e1db.tar.xz
ath5k: ensure led name is null terminated
Add the missing null termination after strncpy(). This isn't actually a buffer overflow in this case since we use snprintf() appropriately to fill the buffer passed by the caller, but in the interest of not turning this into a bug down the road, go ahead and force termination here. Found by Coverity. Signed-off-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath5k/led.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath5k/led.c b/drivers/net/wireless/ath/ath5k/led.c
index 48a6a69b..2062d11 100644
--- a/drivers/net/wireless/ath/ath5k/led.c
+++ b/drivers/net/wireless/ath/ath5k/led.c
@@ -130,6 +130,7 @@ ath5k_register_led(struct ath5k_hw *ah, struct ath5k_led *led,
led->ah = ah;
strncpy(led->name, name, sizeof(led->name));
+ led->name[sizeof(led->name)-1] = 0;
led->led_dev.name = led->name;
led->led_dev.default_trigger = trigger;
led->led_dev.brightness_set = ath5k_led_brightness_set;