Merge pull request #13713 from miri64/gnrc_sixlowpan_iphc/bug/encode-zero-header

gnrc_sixlowpan_iphc: zero IPv6 header before decompressing into it
This commit is contained in:
benpicco 2020-03-25 16:43:17 +01:00 committed by GitHub
commit 53790d1269
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -158,6 +158,9 @@ static size_t _iphc_ipv6_decode(const uint8_t *iphc_hdr,
payload_offset++;
}
/* bits of the uncompressed address might not be written in decompression,
* so zero the whole header first */
memset(ipv6_hdr, 0, sizeof(*ipv6_hdr));
ipv6_hdr_set_version(ipv6_hdr);
switch (iphc_hdr[IPHC1_IDX] & SIXLOWPAN_IPHC1_TF) {