about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/shm_open.c
diff options
context:
space:
mode:
authorOndřej Bílka <neleai@seznam.cz>2013-12-03 20:16:01 +0100
committerOndřej Bílka <neleai@seznam.cz>2013-12-03 20:16:33 +0100
commitb20de2c3d9d751eb259c321426188eefc64fcbe9 (patch)
tree7dbc63638366cb722b5916fc4f6cd965c664dc39 /sysdeps/unix/sysv/linux/shm_open.c
parent34e16df5a1a46e128edb9eb44a09ac5762957136 (diff)
downloadglibc-b20de2c3d9d751eb259c321426188eefc64fcbe9.tar.gz
glibc-b20de2c3d9d751eb259c321426188eefc64fcbe9.tar.xz
glibc-b20de2c3d9d751eb259c321426188eefc64fcbe9.zip
Properly handle shm_open validation. Fixes bug 16274.
Diffstat (limited to 'sysdeps/unix/sysv/linux/shm_open.c')
-rw-r--r--sysdeps/unix/sysv/linux/shm_open.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sysdeps/unix/sysv/linux/shm_open.c b/sysdeps/unix/sysv/linux/shm_open.c
index 482b49cfe6..7bb28744c1 100644
--- a/sysdeps/unix/sysv/linux/shm_open.c
+++ b/sysdeps/unix/sysv/linux/shm_open.c
@@ -151,7 +151,7 @@ shm_open (const char *name, int oflag, mode_t mode)
   namelen = strlen (name);
 
   /* Validate the filename.  */
-  if (name[0] == '\0' || namelen > NAME_MAX || strchr (name, '/') == NULL)
+  if (name[0] == '\0' || namelen > NAME_MAX || strchr (name, '/') != NULL)
     {
       __set_errno (EINVAL);
       return -1;
@@ -241,7 +241,7 @@ shm_unlink (const char *name)
   namelen = strlen (name);
 
   /* Validate the filename.  */
-  if (name[0] == '\0' || namelen > NAME_MAX || strchr (name, '/') == NULL)
+  if (name[0] == '\0' || namelen > NAME_MAX || strchr (name, '/') != NULL)
     {
       __set_errno (ENOENT);
       return -1;