Discussion:
[strongSwan-dev] 5.5.3 compilation error
Emeric POUPON
2017-06-20 09:49:16 UTC
Permalink
Hello,

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.
Not sure about the fix, what do you think?

Emeric
Tobias Brunner
2017-06-20 10:18:16 UTC
Permalink
Hi Emeric,
Post by Emeric POUPON
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

Continue reading on narkive:
Loading...