Skip to content

Commit

Permalink
unix: sometimes a safety comment is a prayer
Browse files Browse the repository at this point in the history
Co-authored-by: Jonas Böttiger <jonasboettiger@icloud.com>
  • Loading branch information
workingjubilee and joboet authored Jul 17, 2024
1 parent eea90e8 commit ff17e4d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions library/std/src/sys/pal/unix/stack_overflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,7 @@ mod imp {
_data: *mut libc::c_void,
) {
let (start, end) = GUARD.get();
if info.is_null() || !info.is_aligned() {
rtabort!("signal handler passed null/non-aligned siginfo_t ptr")
};
// SAFETY: we've done our due diligence, so assume the pointer is to a real siginfo_t
// SAFETY: this pointer is provided by the system and will always point to a valid `siginfo_t`.
let addr = unsafe { (*info).si_addr() as usize };

// If the faulting address is within the guard page, then we print a
Expand Down

0 comments on commit ff17e4d

Please sign in to comment.