Fix: zero-initialize fd_set
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 3 Aug 2016 18:14:33 +0000 (14:14 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 3 Aug 2016 18:14:33 +0000 (14:14 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/regression/kernel/select_poll_epoll.c

index 20988a370cdd28e8ce545d7341efd1955b4e82b9..dfb52370bf761a050ca68ac64a8f88ae42411d1b 100644 (file)
@@ -442,7 +442,7 @@ void ppoll_fds_ulong_max(void)
  */
 void pselect_fd_too_big(void)
 {
-       long rfds[2048 / (sizeof(long) * CHAR_BIT)];
+       long rfds[2048 / (sizeof(long) * CHAR_BIT)] = { 0 };
        int ret;
        int fd2;
        char buf[BUF_SIZE];
@@ -456,7 +456,7 @@ void pselect_fd_too_big(void)
                perror("dup2");
                return;
        }
-       FD_ZERO((fd_set *) &rfds);
+
        FD_SET(fd2, (fd_set *) &rfds);
        ret = syscall(SYS_pselect6, fd2 + 1, &rfds, NULL, NULL, NULL, NULL);
 
This page took 0.026751 seconds and 4 git commands to generate.