[patch] don't try to access list members to free them unless already initialised

npiazza at disroot.org npiazza at disroot.org
Fri Apr 21 07:58:42 PDT 2023


taken from openbsd ports, and used by many linux distributions.

https://github.com/openbsd/ports/blob/master/security/wpa_supplicant/patches/patch-src_utils_eloop_c

does it make sense to include it in wpa_supplicant?

---

Don't try to access list members to free them unless already
initialised

Index: src/utils/eloop.c
--- src/utils/eloop.c.orig
+++ src/utils/eloop.c
@@ -1254,6 +1254,9 @@ void eloop_destroy(void)
 	struct eloop_timeout *timeout, *prev;
 	struct os_reltime now;
 
+	if (eloop.timeout.prev == NULL)
+		return;
+
 	os_get_reltime(&now);
 	dl_list_for_each_safe(timeout, prev, &eloop.timeout,
 			      struct eloop_timeout, list) {




More information about the Hostap mailing list