mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 14:46:12 -04:00
Fix dangling string_view UAF.
PiperOrigin-RevId: 915643410
This commit is contained in:
committed by
Copybara-Service
parent
7d84d08619
commit
6a70c3d49b
@@ -2258,16 +2258,15 @@ void NearbySharingServiceImpl::OnIncomingAdvertisementDecoded(
|
||||
// data to lambda.
|
||||
GetCertificateManager()->GetDecryptedPublicCertificate(
|
||||
std::move(encrypted_metadata_key),
|
||||
[this, endpoint_id, advertisement_copy = *advertisement,
|
||||
placeholder_share_target_id](
|
||||
[this, endpoint_id = std::string(endpoint_id),
|
||||
advertisement_copy = *advertisement, placeholder_share_target_id](
|
||||
std::optional<NearbyShareDecryptedPublicCertificate>
|
||||
decrypted_public_certificate) {
|
||||
RunOnNearbySharingServiceThread(
|
||||
"incoming_decrypted_certificate",
|
||||
// capture endpoint_id string_view as a std::string to ensure the
|
||||
// data does not go out of scope.
|
||||
[this, endpoint_id = std::string(endpoint_id), advertisement_copy,
|
||||
placeholder_share_target_id,
|
||||
[this, endpoint_id, advertisement_copy, placeholder_share_target_id,
|
||||
decrypted_public_certificate =
|
||||
std::move(decrypted_public_certificate)]() {
|
||||
OnIncomingDecryptedCertificate(endpoint_id, advertisement_copy,
|
||||
|
||||
Reference in New Issue
Block a user