mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Fix range check in sigismember(3).
This commit is contained in:
parent
6af85a5dd8
commit
5c58b65546
1 changed files with 2 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
|||
/*******************************************************************************
|
||||
|
||||
Copyright(C) Jonas 'Sortie' Termansen 2013.
|
||||
Copyright(C) Jonas 'Sortie' Termansen 2013, 2014.
|
||||
|
||||
This file is part of the Sortix C Library.
|
||||
|
||||
|
@ -29,7 +29,7 @@
|
|||
extern "C" int sigismember(const sigset_t* set, int signum)
|
||||
{
|
||||
int max_signals = sizeof(set->__val) * 8;
|
||||
if ( max_signals <= signum )
|
||||
if ( signum < 0 || max_signals <= signum )
|
||||
return errno = EINVAL, -1;
|
||||
size_t which_byte = signum / 8;
|
||||
size_t which_bit = signum % 8;
|
||||
|
|
Loading…
Reference in a new issue