Skip to content

Commit

Permalink
Prevent NUM_SIGS from touching sig_set_
Browse files Browse the repository at this point in the history
  • Loading branch information
saagarjha committed Mar 8, 2020
1 parent 0e642a0 commit cd2cff1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fs/tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ ssize_t tty_input(struct tty *tty, const char *input, size_t size, bool blocking
unlock(&tty->lock);

if (fg_group != 0) {
for (int sig = 1; sig <= NUM_SIGS; sig++) {
for (int sig = 1; sig < NUM_SIGS; sig++) {
if (sigset_has(queue, sig))
send_group_signal(fg_group, sig, SIGINFO_NIL);
}
Expand Down
2 changes: 1 addition & 1 deletion kernel/signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ dword_t sys_rt_sigprocmask(dword_t how, addr_t set, addr_t oldset, dword_t size)
int_t sys_rt_sigpending(addr_t set_addr);

static inline sigset_t_ sig_mask(int sig) {
assert(sig >= 1 && sig <= NUM_SIGS);
assert(sig >= 1 && sig < NUM_SIGS);
return 1l << (sig - 1);
}

Expand Down

0 comments on commit cd2cff1

Please sign in to comment.