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@asianux.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
c4f74d35ca
commit
407ee23725
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue