From 407ee23725bba0f273963bb744fea6cb3cf78bf4 Mon Sep 17 00:00:00 2001 From: Chen Gang Date: Mon, 7 Jan 2013 12:42:46 +0800 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 Signed-off-by: John W. Linville --- 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 d604b4036a76..3726cd6fcd75 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; -- 2.39.5