Skip to content

Commit 3ad83bb

Browse files
committed
Use sizeof(sigset_t) instead of _NSIG/8 for raw syscalls
1 parent 15b5960 commit 3ad83bb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/backends/sentry_backend_inproc.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,7 +1574,8 @@ process_ucontext(const sentry_ucontext_t *uctx)
15741574
sigaddset(&mask, uctx->signum);
15751575
// Raw syscall to bypass libsigchain, whose sigprocmask guard
15761576
// is only active inside its own special handlers.
1577-
syscall(SYS_rt_sigprocmask, SIG_BLOCK, &mask, &old_mask, _NSIG / 8);
1577+
syscall(
1578+
SYS_rt_sigprocmask, SIG_BLOCK, &mask, &old_mask, sizeof(sigset_t));
15781579
# endif
15791580

15801581
// invoke the previous handler (typically the CLR/Mono
@@ -1602,10 +1603,11 @@ process_ucontext(const sentry_ucontext_t *uctx)
16021603

16031604
// consume pending signal
16041605
struct timespec timeout = { 0, 0 };
1605-
syscall(SYS_rt_sigtimedwait, &mask, NULL, &timeout, _NSIG / 8);
1606+
syscall(SYS_rt_sigtimedwait, &mask, NULL, &timeout, sizeof(sigset_t));
16061607

16071608
// unmask
1608-
syscall(SYS_rt_sigprocmask, SIG_SETMASK, &old_mask, NULL, _NSIG / 8);
1609+
syscall(
1610+
SYS_rt_sigprocmask, SIG_SETMASK, &old_mask, NULL, sizeof(sigset_t));
16091611
# endif
16101612

16111613
// return from runtime handler; continue processing the crash on the

0 commit comments

Comments
 (0)