From 9a4198822984d6c431c83afb49399b6716e2a436 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Tue, 13 Nov 2018 02:35:03 +0000 Subject: kpathsea: tex-make.c: check return value from dup (from Andreas) git-svn-id: svn://tug.org/texlive/trunk@49141 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/kpathsea/ChangeLog | 4 ++++ Build/source/texk/kpathsea/tex-make.c | 18 +++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'Build/source/texk') diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog index 6341326931e..ddfa0f799e4 100644 --- a/Build/source/texk/kpathsea/ChangeLog +++ b/Build/source/texk/kpathsea/ChangeLog @@ -1,3 +1,7 @@ +2018-11-12 Andreas Scherer + + * tex-make.c (maketex): check return value from dup(2). + 2018-07-02 Karl Berry * kpsewhich.c (lookup): warn that --all is ignored with bitmap fonts. diff --git a/Build/source/texk/kpathsea/tex-make.c b/Build/source/texk/kpathsea/tex-make.c index 95851fdd561..629857a3346 100644 --- a/Build/source/texk/kpathsea/tex-make.c +++ b/Build/source/texk/kpathsea/tex-make.c @@ -318,20 +318,32 @@ maketex (kpathsea kpse, kpse_file_format_type format, string* args) /* stdin -- the child will not receive input from this */ if (childin != 0) { close(0); - dup(childin); + if (dup(childin) != 0) { + perror("kpathsea: dup(2) failed for stdin"); + close(childin); + _exit(1); + } close(childin); } /* stdout -- the output of the child's action */ if (childout[1] != 1) { close(1); - dup(childout[1]); + if (dup(childout[1]) != 1) { + perror("kpathsea: dup(2) failed for stdout"); + close(childout[1]); + _exit(1); + } close(childout[1]); } /* stderr -- use /dev/null if we discard errors */ if (childerr != 2) { if (kpse->make_tex_discard_errors) { close(2); - dup(childerr); + if (dup(childerr) != 2) { + perror("kpathsea: dup(2) failed for stderr"); + close(childerr); + _exit(1); + } } close(childerr); } -- cgit v1.2.3