From: Chen Gang Date: Mon, 7 Jan 2013 04:42:46 +0000 (+0800) Subject: drivers/net/wireless/iwlegacy: use strlcpy instead of strncpy X-Git-Tag: submit/tizen_common/20140905.094502~3690^2~19^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=407ee23725bba0f273963bb744fea6cb3cf78bf4;p=sdk%2Femulator%2Femulator-kernel.git 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 --- 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;