Skip to content

Commit

Permalink
Add explicit memset call to avoid potentially corrupt data. (#277)
Browse files Browse the repository at this point in the history
In kernel 4.19, I saw a kernel crash where kfree was trying to free
some garbage pointer. This occurred because this structure wasn't
explicitly initialized to 0.
  • Loading branch information
saiarcot895 authored and harshavardhana committed Jan 10, 2019
1 parent 1f235cd commit 076ac48
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions os_dep/linux/ioctl_cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -3330,6 +3330,7 @@ void rtw_cfg80211_indicate_sta_assoc(_adapter *padapter, u8 *pmgmt_frame, uint f
#if defined(RTW_USE_CFG80211_STA_EVENT) || defined(COMPAT_KERNEL_RELEASE)
{
struct station_info sinfo;
_rtw_memset(&sinfo, 0, sizeof(struct station_info));

This comment has been minimized.

Copy link
@michalpiekarski

michalpiekarski Jan 11, 2019

This change is causing ISO C90 forbids mixed declarations and code in the next line.

u8 ie_offset;
if (GetFrameSubType(pmgmt_frame) == WIFI_ASSOCREQ)
ie_offset = _ASOCREQ_IE_OFFSET_;
Expand Down

0 comments on commit 076ac48

Please sign in to comment.