drivers/net/wireless/iwlegacy: use strlcpy instead of strncpy
authorChen Gang <gang.chen@asianux.com>
Mon, 7 Jan 2013 04:42:46 +0000 (12:42 +0800)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 7 Jan 2013 19:34:45 +0000 (14:34 -0500)
  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>
drivers/net/wireless/iwlegacy/3945-mac.c

index d604b4036a764358e52bd2c2ca9d02bd24f14ce9..3726cd6fcd754812d65cb38d89782e96aace0de8 100644 (file)
@@ -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;