Skip to content

Commit

Permalink
Merge pull request #332 from tomaspinho/fix-buffer-overflow-6.5.1
Browse files Browse the repository at this point in the history
Attempts a fix at a buffer overflow found in kernels > 6.5.1
  • Loading branch information
tomaspinho authored Sep 15, 2023
2 parents a478095 + 2286e78 commit d8d4095
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/rtw_rf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1050,8 +1050,12 @@ void rtw_txpwr_lmt_add_with_nlen(struct rf_ctl_t *rfctl, const char *regd_name,
ent = LIST_CONTAINOR(cur, struct txpwr_lmt_ent, list);
cur = get_next(cur);

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 5, 1))
if (_rtw_memcmp(ent->regd_name, regd_name, nlen) == _TRUE)
#else
if (strlen(ent->regd_name) == nlen
&& _rtw_memcmp(ent->regd_name, regd_name, nlen) == _TRUE)
#endif
goto chk_lmt_val;
}

Expand Down

0 comments on commit d8d4095

Please sign in to comment.