From 07039d74b17688980bc2eecd83b0a034af0cc229 Mon Sep 17 00:00:00 2001 From: John Barboza Date: Wed, 6 Jun 2018 14:36:46 -0700 Subject: [PATCH] zos: write-protect message queue PR-URL: https://github.com/libuv/libuv/pull/1868 Reviewed-By: Ben Noordhuis Reviewed-By: Colin Ihrig --- src/unix/os390-syscalls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/unix/os390-syscalls.c b/src/unix/os390-syscalls.c index 3895720e..d753b129 100644 --- a/src/unix/os390-syscalls.c +++ b/src/unix/os390-syscalls.c @@ -141,7 +141,7 @@ static void init_message_queue(uv__os390_epoll* lst) { } msg; /* initialize message queue */ - lst->msg_queue = msgget(IPC_PRIVATE, 0622 | IPC_CREAT); + lst->msg_queue = msgget(IPC_PRIVATE, 0600 | IPC_CREAT); if (lst->msg_queue == -1) abort(); @@ -255,7 +255,7 @@ int epoll_ctl(uv__os390_epoll* lst, lst->items[fd].events = event->events; lst->items[fd].revents = 0; } else if (op == EPOLL_CTL_MOD) { - if (fd >= lst->size || lst->items[fd].fd == -1) { + if (fd >= lst->size - 1 || lst->items[fd].fd == -1) { uv_mutex_unlock(&global_epoll_lock); errno = ENOENT; return -1;