diff options
author | Len Baker <len.baker@gmx.com> | 2021-07-18 14:32:07 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-07-27 16:21:13 +0300 |
commit | 246f920cb731950bea4501dc68ab2f8ad66e8b8d (patch) | |
tree | 91a3644fc7cafd870b0ccbbdac8ed6e3eede161d /drivers/staging/rtl8192u | |
parent | 3c6675363de5aa168c23431cf90db455c1901b6e (diff) | |
download | linux-246f920cb731950bea4501dc68ab2f8ad66e8b8d.tar.xz |
staging/rtl8192u: Remove all strcpy() uses in favor of strscpy()
strcpy() performs no bounds checking on the destination buffer. This
could result in linear overflows beyond the end of the buffer, leading
to all kinds of misbehaviors. The safe replacement is strscpy().
Signed-off-by: Len Baker <len.baker@gmx.com>
Link: https://lore.kernel.org/r/20210718113207.10045-1-len.baker@gmx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8192u')
-rw-r--r-- | drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c index ab885353f668..1a193f900779 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c @@ -2226,7 +2226,8 @@ static void ieee80211_start_ibss_wq(struct work_struct *work) mutex_lock(&ieee->wx_mutex); if (ieee->current_network.ssid_len == 0) { - strcpy(ieee->current_network.ssid, IEEE80211_DEFAULT_TX_ESSID); + strscpy(ieee->current_network.ssid, IEEE80211_DEFAULT_TX_ESSID, + sizeof(ieee->current_network.ssid)); ieee->current_network.ssid_len = strlen(IEEE80211_DEFAULT_TX_ESSID); ieee->ssid_set = 1; } |