+ Added check for name greater than PATH_MAX

This commit is contained in:
Jennifer Averett
1999-12-23 22:10:13 +00:00
parent 7fbef78639
commit afebb3fa2a
2 changed files with 28 additions and 0 deletions

View File

@@ -43,6 +43,20 @@ int _POSIX_Semaphore_Create_support(
set_errno_and_return_minus_one( ENOSYS ); set_errno_and_return_minus_one( ENOSYS );
} }
if ( name ) {
if( strlen(name) > PATH_MAX ) { /* XXX - Is strlen ok to use here ? */
_Thread_Enable_dispatch();
set_errno_and_return_minus_one( ENAMETOOLONG );
}
/*
* XXX Greater than NAME_MAX while POSIX_NO_TRUNC in effect.
* XXX Error description in POSIX book different for mq_open and mq_unlink
* Why???
*/
}
the_semaphore = _POSIX_Semaphore_Allocate(); the_semaphore = _POSIX_Semaphore_Allocate();
if ( !the_semaphore ) { if ( !the_semaphore ) {

View File

@@ -43,6 +43,20 @@ int _POSIX_Semaphore_Create_support(
set_errno_and_return_minus_one( ENOSYS ); set_errno_and_return_minus_one( ENOSYS );
} }
if ( name ) {
if( strlen(name) > PATH_MAX ) { /* XXX - Is strlen ok to use here ? */
_Thread_Enable_dispatch();
set_errno_and_return_minus_one( ENAMETOOLONG );
}
/*
* XXX Greater than NAME_MAX while POSIX_NO_TRUNC in effect.
* XXX Error description in POSIX book different for mq_open and mq_unlink
* Why???
*/
}
the_semaphore = _POSIX_Semaphore_Allocate(); the_semaphore = _POSIX_Semaphore_Allocate();
if ( !the_semaphore ) { if ( !the_semaphore ) {