hostapd: fix use after free bugs
Using a pointer one lifter after it freed is not the best idea.
Let's not do that.
Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry-picked from commit 63c01ad025)
			
			
This commit is contained in:
		 David Bauer
					David Bauer
				
			
				
					committed by
					
						 Felix Fietkau
						Felix Fietkau
					
				
			
			
				
	
			
			
			 Felix Fietkau
						Felix Fietkau
					
				
			
						parent
						
							0b75372275
						
					
				
				
					commit
					75f72696b5
				
			| @@ -235,22 +235,22 @@ | |||||||
|  		wpabuf_free(sta->p2p_ie); |  		wpabuf_free(sta->p2p_ie); | ||||||
| --- a/src/ap/sta_info.c | --- a/src/ap/sta_info.c | ||||||
| +++ b/src/ap/sta_info.c | +++ b/src/ap/sta_info.c | ||||||
| @@ -424,6 +424,7 @@ void ap_handle_timer(void *eloop_ctx, vo | @@ -423,6 +423,7 @@ void ap_handle_timer(void *eloop_ctx, vo | ||||||
|  |  		hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, | ||||||
|  			       HOSTAPD_LEVEL_INFO, "deauthenticated due to " |  			       HOSTAPD_LEVEL_INFO, "deauthenticated due to " | ||||||
|  			       "local deauth request"); |  			       "local deauth request"); | ||||||
|  		ap_free_sta(hapd, sta); |  | ||||||
| +		hostapd_ubus_notify(hapd, "local-deauth", sta->addr); | +		hostapd_ubus_notify(hapd, "local-deauth", sta->addr); | ||||||
|  |  		ap_free_sta(hapd, sta); | ||||||
|  		return; |  		return; | ||||||
|  	} |  	} | ||||||
|   | @@ -578,6 +579,7 @@ skip_poll: | ||||||
| @@ -579,6 +580,7 @@ skip_poll: |  		mlme_deauthenticate_indication( | ||||||
|  			hapd, sta, |  			hapd, sta, | ||||||
|  			WLAN_REASON_PREV_AUTH_NOT_VALID); |  			WLAN_REASON_PREV_AUTH_NOT_VALID); | ||||||
|  		ap_free_sta(hapd, sta); |  | ||||||
| +		hostapd_ubus_notify(hapd, "inactive-deauth", sta->addr); | +		hostapd_ubus_notify(hapd, "inactive-deauth", sta->addr); | ||||||
|  |  		ap_free_sta(hapd, sta); | ||||||
|  		break; |  		break; | ||||||
|  	} |  	} | ||||||
|  } |  | ||||||
| @@ -1294,6 +1296,7 @@ void ap_sta_set_authorized(struct hostap | @@ -1294,6 +1296,7 @@ void ap_sta_set_authorized(struct hostap | ||||||
|  					  buf, ip_addr, keyid_buf); |  					  buf, ip_addr, keyid_buf); | ||||||
|  	} else { |  	} else { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user