Skip to content

Commit

Permalink
Fix fuzzy test case libspdm_test_responder_chunk_send_ack_case1
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaohanjlll <hanx.xiao@intel.com>
  • Loading branch information
Xiaohanjlll committed Mar 18, 2024
1 parent 4c2817b commit bb2abc2
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Copyright Notice:
* Copyright 2021-2022 DMTF. All rights reserved.
* Copyright 2021-2024 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 @@ -90,6 +90,12 @@ void libspdm_test_responder_chunk_send_ack_case1(void **State)
do
{
if (chunk_num == 0) {
/* (uint32_t)LargeMessageSize This field shall only be present when ChunkSeqNo
* is zero and shall have a non-zero value.
* The bytes_total should not be less than the minimum effective size.*/
if(bytes_total < sizeof(spdm_chunk_send_request_t) + sizeof(uint32_t)) {
break;
}
chunk_send_request = (spdm_chunk_send_request_t *)request;
spdm_message_header_t *test_spdm_message_header_t;

Expand Down Expand Up @@ -155,7 +161,8 @@ void libspdm_test_responder_chunk_send_ack_case1(void **State)
if (status != LIBSPDM_STATUS_SUCCESS) {
break;
}
} while (bytes_sent < bytes_total);
/* The remaining number of bytes should not be less than the minimum effective size*/
} while (bytes_sent < (bytes_total - sizeof(spdm_chunk_send_request_t)));
}

libspdm_test_context_t m_libspdm_responder_chunk_send_ack_test_context = {
Expand Down

0 comments on commit bb2abc2

Please sign in to comment.