]> granicus.if.org Git - sudo/commitdiff
Ignore the result of send() on exec error, if it fails the other
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 7 May 2016 10:47:12 +0000 (04:47 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 7 May 2016 10:47:12 +0000 (04:47 -0600)
end of the pipe is gone and we are headed for exit.
Coverity CID 104066.

src/exec.c

index c0128512d3ca08f88e214822e8600ce851c44517..0a6f7471cba60b2f432d7bc8d68615ecc606c1d5 100644 (file)
@@ -133,7 +133,7 @@ fork_cmnd(struct command_details *details, int sv[2])
        close(signal_pipe[1]);
        (void)fcntl(sv[1], F_SETFD, FD_CLOEXEC);
        exec_cmnd(details, &cstat, sv[1]);
-       send(sv[1], &cstat, sizeof(cstat), 0);
+       ignore_result(send(sv[1], &cstat, sizeof(cstat), 0));
        sudo_debug_exit_int(__func__, __FILE__, __LINE__, sudo_debug_subsys, 1);
        _exit(1);
     }