mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Fixes access ponter after free in connection_info.channel->GetMedium()
PiperOrigin-RevId: 393904932
This commit is contained in:
committed by
Copybara-Service
parent
ebec902cb8
commit
f37dfd2e8a
@@ -334,12 +334,13 @@ void BasePcpHandler::OnEncryptionSuccessRunnable(
|
|||||||
}
|
}
|
||||||
|
|
||||||
BasePcpHandler::PendingConnectionInfo& connection_info = it->second;
|
BasePcpHandler::PendingConnectionInfo& connection_info = it->second;
|
||||||
|
Medium medium = connection_info.channel->GetMedium();
|
||||||
|
|
||||||
if (!ukey2) {
|
if (!ukey2) {
|
||||||
// Fail early, if there is no crypto context.
|
// Fail early, if there is no crypto context.
|
||||||
ProcessPreConnectionInitiationFailure(
|
ProcessPreConnectionInitiationFailure(
|
||||||
connection_info.client, connection_info.channel->GetMedium(),
|
connection_info.client, medium, endpoint_id,
|
||||||
endpoint_id, connection_info.channel.get(), connection_info.is_incoming,
|
connection_info.channel.get(), connection_info.is_incoming,
|
||||||
connection_info.start_time, {Status::kEndpointIoError},
|
connection_info.start_time, {Status::kEndpointIoError},
|
||||||
connection_info.result.lock().get());
|
connection_info.result.lock().get());
|
||||||
return;
|
return;
|
||||||
@@ -392,14 +393,12 @@ void BasePcpHandler::OnEncryptionSuccessRunnable(
|
|||||||
|
|
||||||
if (connection_info.is_incoming) {
|
if (connection_info.is_incoming) {
|
||||||
connection_info.client->GetAnalyticsRecorder().OnIncomingConnectionAttempt(
|
connection_info.client->GetAnalyticsRecorder().OnIncomingConnectionAttempt(
|
||||||
proto::connections::INITIAL, connection_info.channel->GetMedium(),
|
proto::connections::INITIAL, medium, proto::connections::RESULT_SUCCESS,
|
||||||
proto::connections::RESULT_SUCCESS,
|
|
||||||
SystemClock::ElapsedRealtime() - connection_info.start_time,
|
SystemClock::ElapsedRealtime() - connection_info.start_time,
|
||||||
connection_info.connection_token);
|
connection_info.connection_token);
|
||||||
} else {
|
} else {
|
||||||
connection_info.client->GetAnalyticsRecorder().OnOutgoingConnectionAttempt(
|
connection_info.client->GetAnalyticsRecorder().OnOutgoingConnectionAttempt(
|
||||||
endpoint_id, proto::connections::INITIAL,
|
endpoint_id, proto::connections::INITIAL, medium,
|
||||||
connection_info.channel->GetMedium(),
|
|
||||||
proto::connections::RESULT_SUCCESS,
|
proto::connections::RESULT_SUCCESS,
|
||||||
SystemClock::ElapsedRealtime() - connection_info.start_time,
|
SystemClock::ElapsedRealtime() - connection_info.start_time,
|
||||||
connection_info.connection_token);
|
connection_info.connection_token);
|
||||||
|
|||||||
@@ -559,7 +559,7 @@ void BwuManager::ProcessBwuPathAvailableEvent(
|
|||||||
}
|
}
|
||||||
|
|
||||||
client->GetAnalyticsRecorder().OnOutgoingConnectionAttempt(
|
client->GetAnalyticsRecorder().OnOutgoingConnectionAttempt(
|
||||||
endpoint_id, proto::connections::UPGRADE, channel->GetMedium(),
|
endpoint_id, proto::connections::UPGRADE, medium_,
|
||||||
connection_attempt_result,
|
connection_attempt_result,
|
||||||
SystemClock::ElapsedRealtime() - connection_attempt_start_time,
|
SystemClock::ElapsedRealtime() - connection_attempt_start_time,
|
||||||
client->GetConnectionToken(endpoint_id));
|
client->GetConnectionToken(endpoint_id));
|
||||||
|
|||||||
Reference in New Issue
Block a user