Przeglądaj źródła

Merge pull request #332 from tomaspinho/fix-buffer-overflow-6.5.1

Attempts a fix at a buffer overflow found in kernels > 6.5.1
Tomás Pinho 2 lat temu
rodzic
commit
d8d40954f0
1 zmienionych plików z 4 dodań i 0 usunięć
  1. 4 0
      core/rtw_rf.c

+ 4 - 0
core/rtw_rf.c

@@ -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;
 	}