summaryrefslogtreecommitdiffstats
path: root/librt/shm.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2009-07-03 00:20:19 +0200
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2009-10-12 19:24:34 +0200
commit15c8ae9a828aebd9ffede30ba5f6e7d5dc7db01b (patch)
tree28e808e3e813914561be6c7e9d9d32b44a0ae358 /librt/shm.c
parentd07b0ffce73e0218195f48ce62bde52a4ede25c6 (diff)
downloaduClibc-alpine-15c8ae9a828aebd9ffede30ba5f6e7d5dc7db01b.tar.bz2
uClibc-alpine-15c8ae9a828aebd9ffede30ba5f6e7d5dc7db01b.tar.xz
add testcases for shm_{open,unlink}
Reported-by: Mikael Lund Jepsen <mlj@iccc.dk> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'librt/shm.c')
-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;