mblaze

Unix utilities to deal with Maildir - my mirror
git clone https://pi.duncano.de/git/mblaze.git
Log | Files | Refs | README | COPYING

commit 3b97f3794e2589a93aa4aa7a503cbb6855edd462
parent 94854ad1852527b3ef03b323948c2fd6c63803ef
Author: Leah Neukirchen <leah@vuxu.org>
Date:   Tue, 23 May 2017 15:31:46 +0200

pipeto: check argv[0] is set

This path couldn't so far be triggered, but can be useful if we reuse
this code.

Diffstat:
pipeto.c | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 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;