[strongSwan-dev] 5.5.3 compilation error

Tobias Brunner tobias at strongswan.org
Tue Jun 20 12:18:16 CEST 2017


Hi Emeric,

> Compiling strongSwan 5.5.3 gives this issue:
> kernel_pfroute_net.c: In function 'enumerate_subnets':
> kernel_pfroute_net.c:1732:14: error: 'netmask' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>   if (sockaddr->sa_family == 255)
>               ^
> kernel_pfroute_net.c:1834:20: note: 'netmask' was declared here
>    struct sockaddr *netmask;
>                     ^
> There is indeed a path where netmask is used with no initialization.

Yes, if there is a route entry that has an RTAX_DST but no RTAX_NETMASK
that's the case.  Not sure if that's possible, though.  Just to make
sure the patch in the kernel-pfroute-netmask-init branch initializes the
variable and makes sure it is set before accessing it.

Thanks,
Tobias


More information about the Dev mailing list