From 5dc2dfca86ec1cd754327dfd9a8c50b1ef380882 Mon Sep 17 00:00:00 2001 From: Jon Shallow Date: Mon, 20 Dec 2021 20:31:37 +0000 Subject: [PATCH] block.c: Do not match large response if no Block2 option in request Allows a following request not to match cached multi-payload large response. --- src/block.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/block.c b/src/block.c index 0563fbfe..a8723843 100644 --- a/src/block.c +++ b/src/block.c @@ -992,9 +992,9 @@ coap_handle_request_send_block(coap_session_t *session, uint32_t out_blocks[1]; const char *error_phrase; - if (coap_get_block(pdu, COAP_OPTION_BLOCK2, &block)) { - block_opt = COAP_OPTION_BLOCK2; - } + if (!coap_get_block(pdu, COAP_OPTION_BLOCK2, &block)) + return 0; + block_opt = COAP_OPTION_BLOCK2; LL_FOREACH(session->lg_xmit, p) { size_t chunk; coap_opt_iterator_t opt_iter;