From b20de2c3d9d751eb259c321426188eefc64fcbe9 Mon Sep 17 00:00:00 2001 From: Ondřej Bílka Date: Tue, 3 Dec 2013 20:16:01 +0100 Subject: Properly handle shm_open validation. Fixes bug 16274. --- sysdeps/unix/sysv/linux/shm_open.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sysdeps/unix') 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; -- cgit 1.4.1