diff options
Diffstat (limited to 'cpukit/posix/src/seminit.c')
-rw-r--r-- | cpukit/posix/src/seminit.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cpukit/posix/src/seminit.c b/cpukit/posix/src/seminit.c index cc47312172..249edf67ee 100644 --- a/cpukit/posix/src/seminit.c +++ b/cpukit/posix/src/seminit.c @@ -43,8 +43,13 @@ int sem_init( int status; POSIX_Semaphore_Control *the_semaphore; - if ( !sem ) + if ( sem == NULL ) { rtems_set_errno_and_return_minus_one( EINVAL ); + } + + if ( value > SEM_VALUE_MAX ) { + rtems_set_errno_and_return_minus_one( EINVAL ); + } _Objects_Allocator_lock(); status = _POSIX_Semaphore_Create_support( |