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:
Родитель
c4f74d35ca
Коммит
407ee23725
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче