core: use memcpy_safe()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 8 Aug 2018 06:52:46 +0000 (15:52 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 8 Aug 2018 08:11:43 +0000 (17:11 +0900)
Fixes #9738.

src/core/execute.c

index a35dbac..ecf0f7c 100644 (file)
@@ -3216,7 +3216,7 @@ static int exec_child(
                 }
 
                 fds_with_exec_fd = newa(int, n_fds + 1);
-                memcpy(fds_with_exec_fd, fds, n_fds * sizeof(int));
+                memcpy_safe(fds_with_exec_fd, fds, n_fds * sizeof(int));
                 fds_with_exec_fd[n_fds] = exec_fd;
                 n_fds_with_exec_fd = n_fds + 1;
         } else {