summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorJennifer Averett <Jennifer.Averett@OARcorp.com>1999-12-23 22:10:13 +0000
committerJennifer Averett <Jennifer.Averett@OARcorp.com>1999-12-23 22:10:13 +0000
commitafebb3fa2a2567c92d0b882b506aa254e8e791d5 (patch)
treee05cdaef858da237fb63ff023f99239aaa7b378c /cpukit
parent+ Debugged. (diff)
downloadrtems-afebb3fa2a2567c92d0b882b506aa254e8e791d5.tar.bz2
+ Added check for name greater than PATH_MAX
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/posix/src/semaphorecreatesupp.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/cpukit/posix/src/semaphorecreatesupp.c b/cpukit/posix/src/semaphorecreatesupp.c
index 6b54050062..8177cf9e94 100644
--- a/cpukit/posix/src/semaphorecreatesupp.c
+++ b/cpukit/posix/src/semaphorecreatesupp.c
@@ -43,6 +43,20 @@ int _POSIX_Semaphore_Create_support(
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();
if ( !the_semaphore ) {