Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/bun_alloc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1685,8 +1685,8 @@ pub unsafe fn free_sensitive_cstr(p: *const core::ffi::c_char) {
// size-agnostic).
unsafe {
let len = libc::strlen(p);
secure_zero(p as *mut u8, len);
crate::default_alloc::free(p as *mut core::ffi::c_void);
secure_zero(p.cast::<u8>().cast_mut(), len);
crate::default_alloc::free(p.cast::<core::ffi::c_void>().cast_mut());
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/bun_core/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3927,7 +3927,7 @@ pub fn dupe_z(bytes: &[u8]) -> *const core::ffi::c_char {
core::ptr::copy_nonoverlapping(bytes.as_ptr(), p, bytes.len());
*p.add(bytes.len()) = 0;
}
p as *const core::ffi::c_char
p.cast_const().cast::<core::ffi::c_char>()
}

/// Port of `bun.freeSensitive(bun.default_allocator, slice)` for the C-string
Expand Down
5 changes: 5 additions & 0 deletions src/runtime/server/FileResponseStream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ struct Sendfile {
has_set_on_writable: bool,
}

#[allow(
clippy::derivable_impls,
reason = "only derivable where the linux/android-gated fields are absent; `Fd` has no \
`Default` impl, so `#[derive(Default)]` would not compile on linux/android"
)]
impl Default for Sendfile {
fn default() -> Self {
Self {
Expand Down
Loading