1
0
Fork 0
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:
Jonas 'Sortie' Termansen 2014-02-01 16:13:03 +01:00
parent 6af85a5dd8
commit 5c58b65546

View file

@ -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;