Skip to content

Commit

Permalink
net/gnrc/tcp: fix uninitialized memory access
Browse files Browse the repository at this point in the history
From the gnrc_pktbuf_mark documentation:

	    It's not guaranteed that `result->data` points to the
	    same address as the original `pkt->data.

Thus it should be necessary to update the `tcp` pointer.
  • Loading branch information
nmeum committed Aug 12, 2019
1 parent 7705f6a commit 60070aa
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sys/net/gnrc/transport_layer/tcp/gnrc_tcp_eventloop.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ static int _receive(gnrc_pktsnip_t *pkt)
return -ENOMSG;
}
pkt->type = GNRC_NETTYPE_UNDEF;
hdr = (tcp_hdr_t *)tcp->data;
}

/* Validate checksum */
Expand Down

0 comments on commit 60070aa

Please sign in to comment.