From: Heiko Schlittermann (HS12-RIPE) Date: Wed, 9 Mar 2016 10:51:31 +0000 (+0100) Subject: Test the return of getcwd() X-Git-Tag: exim-4_87_RC7~21 X-Git-Url: https://git.exim.org/exim.git/commitdiff_plain/fae3a611be53dbf58cbb7c2c4846081ecb87606e?ds=sidebyside Test the return of getcwd() --- diff --git a/src/src/exim.c b/src/src/exim.c index 574e7804b..3b6a9ba69 100644 --- a/src/src/exim.c +++ b/src/src/exim.c @@ -3748,7 +3748,11 @@ directory to "/"! Later we change to $spool_directory. We do it there, because during readconf_main() some expansion takes place already. */ /* Store the initial cwd before we change directories */ -initial_cwd = getcwd(NULL, 0); +if ((initial_cwd = getcwd(NULL, 0)) == NULL) + { + perror("exim: can't get the current working directory"); + exit(EXIT_FAILURE); + } readconf_main();