Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit eb6a401

Browse files
brgavinoBrandon Gavino
andauthored
Allocate and copy null terminator when copying fingerprint string (#541)
Co-authored-by: Brandon Gavino <[email protected]>
1 parent 868f0d3 commit eb6a401

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

talk/owt/sdk/conference/conferencewebtransportchannel.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ void ConferenceWebTransportChannel::Connect() {
100100
int fingerprint_idx = 0;
101101
for (auto fingerprint : trusted_fingerprints) {
102102
quic_params.server_certificate_fingerprints[fingerprint_idx]->fingerprint =
103-
new char[fingerprint.length()];
103+
new char[fingerprint.length()+1];
104104
memcpy((void*)(quic_params.server_certificate_fingerprints[fingerprint_idx]->fingerprint),
105-
fingerprint.c_str(), fingerprint.length());
105+
fingerprint.c_str(), fingerprint.length()+1);
106106
}
107107
RTC_LOG(LS_INFO) << "Creating Quic transport client.";
108108
quic_transport_client_.reset(quic_transport_factory_->CreateQuicTransportClient(

0 commit comments

Comments
 (0)