Browse Source

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>
Chen Gang 12 years ago
parent
commit
407ee23725
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/net/wireless/iwlegacy/3945-mac.c

+ 1 - 1
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;