diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
commit | a90a5cba08fdf6c0ceb95101c275108a152a3aed (patch) | |
tree | 532507288f3defd7f4dcf1af49698bcb76034855 /security/manager/ssl/ipcclientcerts/src/backend.rs | |
parent | Adding debian version 126.0.1-1. (diff) | |
download | firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.tar.xz firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'security/manager/ssl/ipcclientcerts/src/backend.rs')
-rw-r--r-- | security/manager/ssl/ipcclientcerts/src/backend.rs | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/security/manager/ssl/ipcclientcerts/src/backend.rs b/security/manager/ssl/ipcclientcerts/src/backend.rs index 534eecd47e..44048d3116 100644 --- a/security/manager/ssl/ipcclientcerts/src/backend.rs +++ b/security/manager/ssl/ipcclientcerts/src/backend.rs @@ -282,7 +282,9 @@ impl Sign for Key { unsafe extern "C" fn sign_callback(data_len: usize, data: *const u8, ctx: *mut c_void) { let signature: &mut Vec<u8> = std::mem::transmute(ctx); signature.clear(); - signature.extend_from_slice(std::slice::from_raw_parts(data, data_len)); + if data_len != 0 { + signature.extend_from_slice(std::slice::from_raw_parts(data, data_len)); + } } unsafe extern "C" fn find_objects_callback( @@ -294,8 +296,16 @@ unsafe extern "C" fn find_objects_callback( slot_type: u32, ctx: *mut c_void, ) { - let data = std::slice::from_raw_parts(data, data_len); - let extra = std::slice::from_raw_parts(extra, extra_len); + let data = if data_len == 0 { + &[] + } else { + std::slice::from_raw_parts(data, data_len) + }; + let extra = if extra_len == 0 { + &[] + } else { + std::slice::from_raw_parts(extra, extra_len) + }; let slot_type = match slot_type { 1 => SlotType::Modern, 2 => SlotType::Legacy, |