[PATCH] fix initialize the variable before using it.

Baligh Gasmi gasmibal at gmail.com
Fri Jan 12 01:46:41 PST 2024


seg0 and seg1 variables can have any initial value, but they may
cause bss to have a wrong configuration later on.

Signed-off-by: Baligh Gasmi <gasmibal at gmail.com>
---
 src/ap/hostapd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index 6a9b07e86..d6e3e4ede 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -3831,7 +3831,7 @@ static int hostapd_change_config_freq(struct hostapd_data *hapd,
 				      struct hostapd_freq_params *old_params)
 {
 	int channel;
-	u8 seg0, seg1;
+	u8 seg0 = 0, seg1 = 0;
 	struct hostapd_hw_modes *mode;
 
 	if (!params->channel) {
-- 
2.40.1




More information about the Hostap mailing list