From 3b97f3794e2589a93aa4aa7a503cbb6855edd462 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Tue, 23 May 2017 15:31:46 +0200 Subject: pipeto: check argv[0] is set This path couldn't so far be triggered, but can be useful if we reuse this code. --- pipeto.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'pipeto.c') diff --git a/pipeto.c b/pipeto.c index 77982e1..8014584 100644 --- a/pipeto.c +++ b/pipeto.c @@ -51,7 +51,10 @@ pipeto(const char *cmdline) } argv[argc] = 0; - execvp(argv[0], argv); + if (argv[0]) + execvp(argv[0], argv); + else + errno = EINVAL; // execvp failed, write errno to parent long e = errno; -- cgit 1.4.1