Skip to content

Commit

Permalink
Fix chunk_seq_no wrap in chunk get.
Browse files Browse the repository at this point in the history
Fix DMTF#2875

Signed-off-by: Aaron Li <[email protected]>
  • Loading branch information
Li-Aaron committed Jan 13, 2025
1 parent 355d0e3 commit 630d92a
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Copyright Notice:
* Copyright 2021-2024 DMTF. All rights reserved.
* Copyright 2021-2025 DMTF. All rights reserved.
* License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/libspdm/blob/main/LICENSE.md
**/

Expand Down Expand Up @@ -280,6 +280,12 @@ libspdm_return_t libspdm_handle_error_large_response(
spdm_request->chunk_seq_no = chunk_seq_no;
spdm_request_size = sizeof(spdm_chunk_get_request_t);

if (chunk_seq_no == 0 && large_response_size_so_far != 0) {
/* chunk_seq_no wrapped */
status = LIBSPDM_STATUS_INVALID_MSG_FIELD;
break;
}

LIBSPDM_DEBUG((LIBSPDM_DEBUG_INFO,
"CHUNK_GET Handle %d SeqNo %d\n", chunk_handle, chunk_seq_no));

Expand Down

0 comments on commit 630d92a

Please sign in to comment.