Skip to content

Commit

Permalink
drivers/net/wireless/iwlegacy: use strlcpy instead of strncpy
Browse files Browse the repository at this point in the history
  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>
  • Loading branch information
Chen Gang authored and John W. Linville committed Jan 7, 2013
1 parent c4f74d3 commit 407ee23
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/wireless/iwlegacy/3945-mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 407ee23

Please sign in to comment.