summaryrefslogtreecommitdiff
path: root/librt
diff options
context:
space:
mode:
Diffstat (limited to 'librt')
-rw-r--r--librt/shm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/librt/shm.c b/librt/shm.c
index 3f33d68af..c7c0ee461 100644
--- a/librt/shm.c
+++ b/librt/shm.c
@@ -45,6 +45,10 @@ static char* get_shm_name(const char*name)
if (i < 0) {
free(path);
return NULL;
+ } else if (i >= NAME_MAX) {
+ free(path);
+ __set_errno(ENAMETOOLONG);
+ return NULL;
}
#endif
return path;