[PATCH 2/2] NAN: Fix maybe-uninitialized warning in nan_sec_rx()
Jouni Malinen
j at w1.fi
Sat Oct 24 09:09:22 PDT 2026
On Fri, Sep 11, 2026 at 02:09:48AM +0530, Chaitanya Tata wrote:
> instance_id and capab are only set by nan_parse_sec() on some paths
> (the else branch sources them from ndp_sec instead), which is enough
> to defeat GCC's flow analysis at -Os: it flags both as possibly used
> uninitialized when copied into ndp_sec->i_instance_id/i_capab, which
> is fatal for any -Werror build.
>
> Reproduced with plain gcc -Os -Wall -Werror=maybe-uninitialized (GCC
> 13.3.0), no special build options required. Initialize both at
> declaration to keep such builds working.
Thanks, applied.
--
Jouni Malinen PGP id EFC895FA
More information about the Hostap
mailing list