Skip to content

Commit

Permalink
net.c: fix PDU find bug in coap_remove_from_queue()
Browse files Browse the repository at this point in the history
Issue #163 [1] points out that coap_remove_from_queue() may release
the wrong PDU from the retransmit queue due to a false hit in the
do/while loop. This change was proposed by hongnguyen-tma to fix
this issue.

[1] #163
  • Loading branch information
obgm committed Apr 18, 2018
1 parent 8c35e76 commit c4e6601
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -1310,7 +1310,7 @@ coap_remove_from_queue(coap_queue_t **queue, coap_session_t *session, coap_tid_t
do {
p = q;
q = q->next;
} while (q && session != q->session && id != q->id);
} while (q && (session != q->session || id != q->id));

if (q) { /* found transaction */
p->next = q->next;
Expand Down

0 comments on commit c4e6601

Please sign in to comment.