1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #20309 from jia200x/pr/fix_tnt_loopback

gnrc_ipv6: fix double-free when pinging TNT loopback address
This commit is contained in:
benpicco 2024-01-30 11:54:48 +00:00 committed by GitHub
commit 7c8c522a73
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -634,9 +634,13 @@ static void _send_multicast(gnrc_pktsnip_t *pkt, bool prep_hdr,
static void _send_to_self(gnrc_pktsnip_t *pkt, bool prep_hdr,
gnrc_netif_t *netif)
{
if (!_safe_fill_ipv6_hdr(netif, pkt, prep_hdr) ||
/* no netif header so we just merge the whole packet. */
(gnrc_pktbuf_merge(pkt) != 0)) {
/* _safe_fill_ipv6_hdr releases pkt on error */
if (!_safe_fill_ipv6_hdr(netif, pkt, prep_hdr)) {
DEBUG("ipv6: error looping packet to sender.\n");
return;
}
/* no netif header so we just merge the whole packet. */
else if (gnrc_pktbuf_merge(pkt) != 0) {
DEBUG("ipv6: error looping packet to sender.\n");
gnrc_pktbuf_release(pkt);
return;