fix rejection of dns responses with pointers past 512 byte offset
[musl] / src / process / posix_spawn_file_actions_addfchdir.c
index 436c683..e89ede8 100644 (file)
@@ -6,6 +6,7 @@
 
 int posix_spawn_file_actions_addfchdir_np(posix_spawn_file_actions_t *fa, int fd)
 {
+       if (fd < 0) return EBADF;
        struct fdop *op = malloc(sizeof *op);
        if (!op) return ENOMEM;
        op->cmd = FDOP_FCHDIR;