diff options
author | Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> | 2014-08-11 14:52:56 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-08-25 16:17:40 -0400 |
commit | f0bd88dfd7e5d53bce84a9d077c949774f27a25a (patch) | |
tree | d345d8626cc6476d8f4a42724851eb2528e98451 | |
parent | 372e3a846814656d5e514167484f684f828fff56 (diff) |
net: wireless: ipw2x00: ipw2200.c: Cleaning up missing null-terminate in conjunction with strncpy
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>
-rw-r--r-- | drivers/net/wireless/ipw2x00/ipw2200.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c index a42f9c335090..f0c3c77a48d3 100644 --- a/drivers/net/wireless/ipw2x00/ipw2200.c +++ b/drivers/net/wireless/ipw2x00/ipw2200.c | |||
@@ -5552,7 +5552,7 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv, | |||
5552 | min(network->ssid_len, priv->essid_len)))) { | 5552 | min(network->ssid_len, priv->essid_len)))) { |
5553 | char escaped[IW_ESSID_MAX_SIZE * 2 + 1]; | 5553 | char escaped[IW_ESSID_MAX_SIZE * 2 + 1]; |
5554 | 5554 | ||
5555 | strncpy(escaped, | 5555 | strlcpy(escaped, |
5556 | print_ssid(ssid, network->ssid, | 5556 | print_ssid(ssid, network->ssid, |
5557 | network->ssid_len), | 5557 | network->ssid_len), |
5558 | sizeof(escaped)); | 5558 | sizeof(escaped)); |
@@ -5765,7 +5765,7 @@ static int ipw_best_network(struct ipw_priv *priv, | |||
5765 | memcmp(network->ssid, priv->essid, | 5765 | memcmp(network->ssid, priv->essid, |
5766 | min(network->ssid_len, priv->essid_len)))) { | 5766 | min(network->ssid_len, priv->essid_len)))) { |
5767 | char escaped[IW_ESSID_MAX_SIZE * 2 + 1]; | 5767 | char escaped[IW_ESSID_MAX_SIZE * 2 + 1]; |
5768 | strncpy(escaped, | 5768 | strlcpy(escaped, |
5769 | print_ssid(ssid, network->ssid, | 5769 | print_ssid(ssid, network->ssid, |
5770 | network->ssid_len), | 5770 | network->ssid_len), |
5771 | sizeof(escaped)); | 5771 | sizeof(escaped)); |
@@ -5782,7 +5782,7 @@ static int ipw_best_network(struct ipw_priv *priv, | |||
5782 | * testing everything else. */ | 5782 | * testing everything else. */ |
5783 | if (match->network && match->network->stats.rssi > network->stats.rssi) { | 5783 | if (match->network && match->network->stats.rssi > network->stats.rssi) { |
5784 | char escaped[IW_ESSID_MAX_SIZE * 2 + 1]; | 5784 | char escaped[IW_ESSID_MAX_SIZE * 2 + 1]; |
5785 | strncpy(escaped, | 5785 | strlcpy(escaped, |
5786 | print_ssid(ssid, network->ssid, network->ssid_len), | 5786 | print_ssid(ssid, network->ssid, network->ssid_len), |
5787 | sizeof(escaped)); | 5787 | sizeof(escaped)); |
5788 | IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded because " | 5788 | IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded because " |