]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
PASN: Clear extra_ies_len to 0 on freeing extra_ies
authorJouni Malinen <j@w1.fi>
Sat, 18 Oct 2025 15:19:51 +0000 (18:19 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 18 Oct 2025 19:32:25 +0000 (22:32 +0300)
There is no point in setting extra_ies_len to the new value in
pasn_set_extra_ies() at the point when the old value is freed. This
setting happens already at the appropriate place after the new value has
been successfully assigned. Set extra_ies_len to 0 here so that it will
have value 0 in case the allocation fails and leaves extra_ies to NULL.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/pasn/pasn_common.c

index e2922117812bff879a46d96ac6f5033952f822aa..3b336715ab3ae0e7fab2e031b53b678c86e13645 100644 (file)
@@ -185,7 +185,7 @@ int pasn_set_extra_ies(struct pasn_data *pasn, const u8 *extra_ies,
 
        if (pasn->extra_ies) {
                os_free((u8 *) pasn->extra_ies);
-               pasn->extra_ies_len = extra_ies_len;
+               pasn->extra_ies_len = 0;
        }
 
        pasn->extra_ies = os_memdup(extra_ies, extra_ies_len);