mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-08-19 09:40:21 +00:00
`switch_stun_packet_attribute_get_xor_mapped_address()` read and XOR-rewrote a 16-byte IPv6 address whenever the `family` byte was 2, without checking the attribute value was that long. Reject `family == 2` values shorter than `sizeof(switch_stun_ipv6_t)` and clear the output address and port. Adds a regression test.
FreeSWITCH unit tests should be kept as shallow unit tests and micro benchmarks testing functionality exposed through libfreeswitch. Requirements for a new unit tests: 1. Tests must use switch_test.h framework