mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-08 10:32:53 +03:00
net.c: fix PDU find bug in coap_remove_from_queue()
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] https://github.com/obgm/libcoap/issues/163
This commit is contained in:
1 parent
8c35e7625b
commit
c4e6601944
1 file changed
+1
-1
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user