Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: rtl8188eu: Do not byteswap half initialized variable

Copying 16 bits into an uninitialized 32 bit stack variable and then
byteswapping it can provide 'interesting' results.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jes Sorensen and committed by
Greg Kroah-Hartman
d6c455ac b5e1e912

+2 -3
+2 -3
drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
··· 6551 6551 struct registry_priv *pregistrypriv = &padapter->registrypriv; 6552 6552 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 6553 6553 struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); 6554 - __le32 le32_tmp; 6555 6554 6556 6555 len = packet_len - sizeof(struct rtw_ieee80211_hdr_3addr); 6557 6556 ··· 6664 6665 return _SUCCESS; 6665 6666 } 6666 6667 6667 - memcpy(&le32_tmp, rtw_get_beacon_interval_from_ie(bssid->IEs), 2); 6668 - bssid->Configuration.BeaconPeriod = le32_to_cpu(le32_tmp); 6668 + bssid->Configuration.BeaconPeriod = 6669 + get_unaligned_le16(rtw_get_beacon_interval_from_ie(bssid->IEs)); 6669 6670 6670 6671 val16 = rtw_get_capability((struct wlan_bssid_ex *)bssid); 6671 6672