summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--c/src/exec/posix/src/mqueuenametoid.c3
-rw-r--r--cpukit/posix/src/mqueuenametoid.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/c/src/exec/posix/src/mqueuenametoid.c b/c/src/exec/posix/src/mqueuenametoid.c
index 45e630d796..9c439513c7 100644
--- a/c/src/exec/posix/src/mqueuenametoid.c
+++ b/c/src/exec/posix/src/mqueuenametoid.c
@@ -48,6 +48,9 @@ int _POSIX_Message_queue_Name_to_id(
if ( !name[0] )
return EINVAL;
+ if( strlen(name) > PATH_MAX ) /* XXX - Is strlen ok to use here ? */
+ return ENAMETOOLONG;
+
status = _Objects_Name_to_id(
&_POSIX_Message_queue_Information, (char *)name, 0, id );
diff --git a/cpukit/posix/src/mqueuenametoid.c b/cpukit/posix/src/mqueuenametoid.c
index 45e630d796..9c439513c7 100644
--- a/cpukit/posix/src/mqueuenametoid.c
+++ b/cpukit/posix/src/mqueuenametoid.c
@@ -48,6 +48,9 @@ int _POSIX_Message_queue_Name_to_id(
if ( !name[0] )
return EINVAL;
+ if( strlen(name) > PATH_MAX ) /* XXX - Is strlen ok to use here ? */
+ return ENAMETOOLONG;
+
status = _Objects_Name_to_id(
&_POSIX_Message_queue_Information, (char *)name, 0, id );