Files
nearby/presence
Bryan Kersting 79ae5cab5a Fix unsound Rust reference in np_ffi_CredentialSlab_add_v0_credential
Currently, in the Rust implementation of `np_ffi_CredentialSlab_add_v0_credential`, we take the underlying buffer of the passed `V0MatchableCredential` and turn it into a Rust `&[u8]` by calling `unsafe slice::from_raw_parts`. The safety contract of `from_raw_parts` states that the passed pointer can neither be null, nor be unaligned. In the `advertisment_decoder_rust_impl.cc` we have a code path that leads to a null pointer being passed, though. We get a nullpointer if we pass a `std::vector` of size 0. This change fixes the issue by making sure we always pass a non-null buffer.

PiperOrigin-RevId: 729417182
2025-02-21 00:37:51 -08:00
..
2024-12-02 21:33:29 -08:00
2022-08-09 12:02:16 -07:00
2025-01-12 19:42:57 -08:00
2024-05-06 09:24:15 -07:00
2022-08-09 12:02:16 -07:00
2022-08-09 12:02:16 -07:00
2022-08-09 12:02:16 -07:00
2022-07-27 16:17:46 -07:00
2022-08-09 12:02:16 -07:00
2024-04-29 13:12:45 -07:00
2022-08-09 12:02:16 -07:00
2023-03-30 13:56:57 -07:00