mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-27 05:21:08 +01:00
Catch and report fdopen failures.
This commit is contained in:
parent
5c7cba96bc
commit
64ae78cb9d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=60826
@ -309,6 +309,11 @@ child_process(e, u)
|
||||
register int escaped = FALSE;
|
||||
register int ch;
|
||||
|
||||
if (out == NULL) {
|
||||
warn("fdopen failed in child2");
|
||||
_exit(ERROR_EXIT);
|
||||
}
|
||||
|
||||
Debug(DPROC, ("[%d] child2 sending data to grandchild\n", getpid()))
|
||||
|
||||
/* close the pipe we don't use, since we inherited it and
|
||||
@ -369,6 +374,11 @@ child_process(e, u)
|
||||
register FILE *in = fdopen(stdout_pipe[READ_PIPE], "r");
|
||||
register int ch = getc(in);
|
||||
|
||||
if (in == NULL) {
|
||||
warn("fdopen failed in child");
|
||||
_exit(ERROR_EXIT);
|
||||
}
|
||||
|
||||
if (ch != EOF) {
|
||||
register FILE *mail;
|
||||
register int bytes = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user