Re: [PATCH 07/11] transport-helper: check dup() return in get_exporter
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Jul 15, 2026, 06:58 UTC
- Message-ID
- <alcvlJABsStbRtw8@pks.im>
- In-Reply-To
- <1792042098cd50ba164b90e5ce62430037661343.1784069325.git.gitgitgadget@gmail.com>
On Tue, Jul 14, 2026 at 10:48:40PM +0000, Johannes Schindelin via GitGitGadget wrote:
Show 13 quoted lines
> diff --git a/transport-helper.c b/transport-helper.c
> index 80f90eb7ba..31883b244e 100644
> --- a/transport-helper.c
> +++ b/transport-helper.c
> @@ -487,6 +487,8 @@ static int get_exporter(struct transport *transport,
> /* we need to duplicate helper->in because we want to use it after
> * fastexport is done with it. */
> fastexport->out = dup(helper->in);
> + if (fastexport->out < 0)
> + return error_errno(_("could not dup helper output fd"));
> strvec_push(&fastexport->args, "fast-export");
> strvec_push(&fastexport->args, "--use-done-feature");
> strvec_push(&fastexport->args, data->signed_tags ?Makes sense. The only caller already knows to die in case it sees a non-zero return value.
Patrick