Commit f0bd88df authored by Rickard Strandqvist's avatar Rickard Strandqvist Committed by John W. Linville

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: default avatarRickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 372e3a84
...@@ -5552,7 +5552,7 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv, ...@@ -5552,7 +5552,7 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
min(network->ssid_len, priv->essid_len)))) { min(network->ssid_len, priv->essid_len)))) {
char escaped[IW_ESSID_MAX_SIZE * 2 + 1]; char escaped[IW_ESSID_MAX_SIZE * 2 + 1];
strncpy(escaped, strlcpy(escaped,
print_ssid(ssid, network->ssid, print_ssid(ssid, network->ssid,
network->ssid_len), network->ssid_len),
sizeof(escaped)); sizeof(escaped));
...@@ -5765,7 +5765,7 @@ static int ipw_best_network(struct ipw_priv *priv, ...@@ -5765,7 +5765,7 @@ static int ipw_best_network(struct ipw_priv *priv,
memcmp(network->ssid, priv->essid, memcmp(network->ssid, priv->essid,
min(network->ssid_len, priv->essid_len)))) { min(network->ssid_len, priv->essid_len)))) {
char escaped[IW_ESSID_MAX_SIZE * 2 + 1]; char escaped[IW_ESSID_MAX_SIZE * 2 + 1];
strncpy(escaped, strlcpy(escaped,
print_ssid(ssid, network->ssid, print_ssid(ssid, network->ssid,
network->ssid_len), network->ssid_len),
sizeof(escaped)); sizeof(escaped));
...@@ -5782,7 +5782,7 @@ static int ipw_best_network(struct ipw_priv *priv, ...@@ -5782,7 +5782,7 @@ static int ipw_best_network(struct ipw_priv *priv,
* testing everything else. */ * testing everything else. */
if (match->network && match->network->stats.rssi > network->stats.rssi) { if (match->network && match->network->stats.rssi > network->stats.rssi) {
char escaped[IW_ESSID_MAX_SIZE * 2 + 1]; char escaped[IW_ESSID_MAX_SIZE * 2 + 1];
strncpy(escaped, strlcpy(escaped,
print_ssid(ssid, network->ssid, network->ssid_len), print_ssid(ssid, network->ssid, network->ssid_len),
sizeof(escaped)); sizeof(escaped));
IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded because " IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded because "
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment