Skip to content

Commit 909ad35

Browse files
vcgomesTomasz Bursztyka
authored andcommitted
lib/zoap: Fix incorrect values for payload size
When retrieving the payload length of the payload, there was a mistake, what was already in the buffer (buf->len) was being considered twice, net_buf_tailroom() already takes buf->len into account, resulting in incorrect values. Change-Id: I3b78d55abca4a448cab5e035b9d66352a3c59110 Signed-off-by: Vinicius Costa Gomes <[email protected]>
1 parent 8ab2a90 commit 909ad35

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/iot/zoap/zoap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ uint8_t *zoap_packet_get_payload(struct zoap_packet *pkt, uint16_t *len)
776776
}
777777

778778
if (len) {
779-
*len = net_buf_tailroom(frag) - frag->len;
779+
*len = net_buf_tailroom(frag);
780780
}
781781

782782
return pkt->start;

0 commit comments

Comments
 (0)