052-AP-add-missing-null-pointer-check-in-hostapd_free_ha.patch 607 B

1234567891011121314151617181920
  1. From: Felix Fietkau <[email protected]>
  2. Date: Wed, 1 May 2024 18:55:24 +0200
  3. Subject: [PATCH] AP: add missing null pointer check in hostapd_free_hapd_data
  4. When called from wpa_supplicant, iface->interfaces can be NULL
  5. Signed-off-by: Felix Fietkau <[email protected]>
  6. ---
  7. --- a/src/ap/hostapd.c
  8. +++ b/src/ap/hostapd.c
  9. @@ -502,7 +502,7 @@ void hostapd_free_hapd_data(struct hosta
  10. struct hapd_interfaces *ifaces = hapd->iface->interfaces;
  11. size_t i;
  12. - for (i = 0; i < ifaces->count; i++) {
  13. + for (i = 0; ifaces && i < ifaces->count; i++) {
  14. struct hostapd_iface *iface = ifaces->iface[i];
  15. size_t j;