mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-25 00:21:09 +03:00
bugfix (Thanks to John Sucaet)
This commit is contained in:
1 parent
7aa393ff65
commit
a30621493f
1 file changed
+2
-1
@@ -123,7 +123,8 @@ coap_add_option(coap_pdu_t *pdu, unsigned short type, unsigned int len, const un
|
||||
opt = options_start(pdu);
|
||||
cnt = pdu->hdr->optcnt;
|
||||
while ((pdu->hdr->optcnt == COAP_OPT_LONG && opt &&
|
||||
opt < data + len && *opt != COAP_OPT_END)
|
||||
opt < ((unsigned char *)pdu->hdr + pdu->max_size) &&
|
||||
*opt != COAP_OPT_END)
|
||||
|| cnt--) {
|
||||
opt_code += COAP_OPT_DELTA(opt);
|
||||
opt = options_next(opt);
|
||||
|
||||
Reference in new issue
Block a user