Dynamic memory stored in 'm_requester_cert_chain_buffer' can be lost
Closed this issue · 0 comments
Zhiqiang520 commented
if add two duplicated parameters --req_cert_chain certchainSample_1.der --req_cert_chain certchainSample_2.der
.
- first time, Dynamic memory stored in
m_requester_cert_chain_buffer
allocated through functionread_input_file
at line 606.
spdm-dump/spdm_dump/spdm_dump.c
Lines 604 to 608 in a4dc28d
- Continue loop iteration at Line 266, while argc>0 is true.
spdm-dump/spdm_dump/spdm_dump.c
Lines 266 to 267 in a4dc28d
- second time, Dynamic memory stored in m_requester_cert_chain_buffer allocated through function read_input_file at line 606,
then the first time dynamic memory stored inm_requester_cert_chain_buffer
is lost.
spdm-dump/spdm_dump/spdm_dump.c
Lines 604 to 608 in a4dc28d
- Maybe we should add the following code before Line 606.
if (m_requester_cert_chain_buffer != NULL) {
free(m_requester_cert_chain_buffer);
}
- The similar case in
--rsp_cert_chain
side.
spdm-dump/spdm_dump/spdm_dump.c
Lines 630 to 634 in a4dc28d