Skip to content

Commit d99be36

Browse files
committed
[nrf fromtree] net: lib: coap_client: Don't match zero length tokens
If our internal structure is cleared, don't match tokens. Signed-off-by: Seppo Takalo <[email protected]> (cherry picked from commit 934c74f)
1 parent b918e92 commit d99be36

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

subsys/net/lib/coap/coap_client.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,9 @@ static struct coap_client_internal_request *get_request_with_token(
687687
for (int i = 0; i < CONFIG_COAP_CLIENT_MAX_REQUESTS; i++) {
688688
if (client->requests[i].request_ongoing ||
689689
!exchange_lifetime_exceeded(&client->requests[i])) {
690+
if (client->requests[i].request_tkl == 0) {
691+
continue;
692+
}
690693
if (client->requests[i].request_tkl != response_tkl) {
691694
continue;
692695
}

0 commit comments

Comments
 (0)