[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <50EA5246.8060206@asianux.com>
Date: Mon, 07 Jan 2013 12:42:46 +0800
From: Chen Gang <gang.chen@...anux.com>
To: sgruszka@...hat.com, linville@...driver.com
CC: linux-wireless@...r.kernel.org, netdev <netdev@...r.kernel.org>
Subject: [PATCH] drivers/net/wireless/iwlegacy: use strlcpy instead of strncpy
The fields must be null-terminated, or simple_strtoul will cause issue.
Signed-off-by: Chen Gang <gang.chen@...anux.com>
---
drivers/net/wireless/iwlegacy/3945-mac.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
index d604b40..3726cd6 100644
--- a/drivers/net/wireless/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/iwlegacy/3945-mac.c
@@ -3273,7 +3273,7 @@ il3945_store_measurement(struct device *d, struct device_attribute *attr,
if (count) {
char *p = buffer;
- strncpy(buffer, buf, min(sizeof(buffer), count));
+ strlcpy(buffer, buf, sizeof(buffer));
channel = simple_strtoul(p, NULL, 0);
if (channel)
params.channel = channel;
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists