Commit fab3f949 authored by Tomasz Bursztyka's avatar Tomasz Bursztyka Committed by Anas Nashif
Browse files

net/ieee802154: Avoid NULL pointer de-reference in packet reassembly

In case the very first fragment holds all the data already.

Signed-off-by: default avatarTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
parent f911248d
Loading
Loading
Loading
Loading
+2 −0
Changes for subsys/net/l2/ieee802154/ieee802154_fragment.c: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -526,9 +526,11 @@ static inline enum net_verdict fragment_add_to_cache(struct net_pkt *pkt)
	fragment_append(cache->pkt, frag);

	if (fragment_cached_pkt_len(cache->pkt) == cache->size) {
		if (!first_frag) {
			/* Assign buffer back to input packet. */
			pkt->buffer = cache->pkt->buffer;
			cache->pkt->buffer = NULL;
		}

		fragment_reconstruct_packet(pkt);