Skip to content

Commit

Permalink
wifi: ieee80211: check for NULL in ieee80211_mle_size_ok()
Browse files Browse the repository at this point in the history
For simplicity, we may want to pass a NULL element, and
while we should then pass also a zero length, just be a
bit more careful here.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240318184907.4d983653cb8d.Ic3ea99b60c61ac2f7d38cb9fd202a03c97a05601@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
jmberg-intel committed Mar 25, 2024
1 parent e959521 commit b7793a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/ieee80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -5166,7 +5166,7 @@ static inline bool ieee80211_mle_size_ok(const u8 *data, size_t len)
bool check_common_len = false;
u16 control;

if (len < fixed)
if (!data || len < fixed)
return false;

control = le16_to_cpu(mle->control);
Expand Down

0 comments on commit b7793a1

Please sign in to comment.