diff mbox series

fix initialize the variable before using it.

Message ID 20240112094641.1798143-1-gasmibal@gmail.com
State Accepted
Headers show
Series fix initialize the variable before using it. | expand

Commit Message

Baligh GASMI Jan. 12, 2024, 9:46 a.m. UTC
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@gmail.com>
---
 src/ap/hostapd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jouni Malinen Jan. 14, 2024, 7:31 p.m. UTC | #1
On Fri, Jan 12, 2024 at 10:46:41AM +0100, Baligh Gasmi wrote:
> seg0 and seg1 variables can have any initial value, but they may
> cause bss to have a wrong configuration later on.

Thanks, applied.
diff mbox series

Patch

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) {