PubSub: using IPv6 incompatible interface for Subscriber leads to buffer overflow (Linux only)
When using interfaceName
configuration for Subscriber and the interface does not support IPv6, a buffer overflow occurs:
==38620==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x606000010498 at pc 0x0000006431e1 bp 0x7ffc35c25a30 sp 0x7ffc35c25a28
READ of size 16 at 0x606000010498 thread T0
#0 0x6431e0 in SOPC_Internal_Fill_IP6_mreq /users/vincent/git/INGOPCS/src/Common/helpers_platform_dep/linux/p_sopc_udp_sockets.c:134
#1 0x6433cf in setMembershipOption /users/vincent/git/INGOPCS/src/Common/helpers_platform_dep/linux/p_sopc_udp_sockets.c:150
#2 0x643a82 in SOPC_UDP_Socket_AddMembership /users/vincent/git/INGOPCS/src/Common/helpers_platform_dep/linux/p_sopc_udp_sockets.c:242
This is due to the fact we are casting address structure into IPv6 version whereas it is not, the function SOPC_Socket_AddrInfo_IsIPV6