mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
gnrc_sixlowpan_iphc: fix null pointer dereference in _iphc_encode()
This commit is contained in:
parent
9728f727e7
commit
639c04325d
@ -1650,6 +1650,11 @@ static gnrc_pktsnip_t *_iphc_encode(gnrc_pktsnip_t *pkt,
|
||||
#ifdef MODULE_GNRC_SIXLOWPAN_IPHC_NHC
|
||||
while (_compressible_nh(nh)) {
|
||||
ssize_t local_pos = 0;
|
||||
if (pkt->next->next == NULL) {
|
||||
DEBUG("6lo iphc: packet next header missing data");
|
||||
gnrc_pktbuf_release(dispatch);
|
||||
return NULL;
|
||||
}
|
||||
switch (nh) {
|
||||
case PROTNUM_UDP:
|
||||
local_pos = _nhc_udp_encode_snip(pkt, &iphc_hdr[inline_pos]);
|
||||
|
Loading…
Reference in New Issue
Block a user