net: wireless: ipw2x00: ipw2200.c: Cleaning up missing null-terminate in conjunction...
authorRickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Mon, 11 Aug 2014 18:52:56 +0000 (20:52 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 25 Aug 2014 20:17:40 +0000 (16:17 -0400)
Replacing strncpy with strlcpy to avoid strings that lacks null terminate.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ipw2x00/ipw2200.c

index a42f9c335090697297165bd6d15d8b6c5594a855..f0c3c77a48d38eb7e2318280ab9492582091c39f 100644 (file)
@@ -5552,7 +5552,7 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
                            min(network->ssid_len, priv->essid_len)))) {
                        char escaped[IW_ESSID_MAX_SIZE * 2 + 1];
 
-                       strncpy(escaped,
+                       strlcpy(escaped,
                                print_ssid(ssid, network->ssid,
                                           network->ssid_len),
                                sizeof(escaped));
@@ -5765,7 +5765,7 @@ static int ipw_best_network(struct ipw_priv *priv,
                     memcmp(network->ssid, priv->essid,
                            min(network->ssid_len, priv->essid_len)))) {
                        char escaped[IW_ESSID_MAX_SIZE * 2 + 1];
-                       strncpy(escaped,
+                       strlcpy(escaped,
                                print_ssid(ssid, network->ssid,
                                           network->ssid_len),
                                sizeof(escaped));
@@ -5782,7 +5782,7 @@ static int ipw_best_network(struct ipw_priv *priv,
         * testing everything else. */
        if (match->network && match->network->stats.rssi > network->stats.rssi) {
                char escaped[IW_ESSID_MAX_SIZE * 2 + 1];
-               strncpy(escaped,
+               strlcpy(escaped,
                        print_ssid(ssid, network->ssid, network->ssid_len),
                        sizeof(escaped));
                IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded because "