提交 407ee237 编写于 作者: C Chen Gang 提交者: John W. Linville

drivers/net/wireless/iwlegacy: use strlcpy instead of strncpy

  The fields must be null-terminated, or simple_strtoul will cause issue.
Signed-off-by: NChen Gang <gang.chen@asianux.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 c4f74d35
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册