summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2022-01-29 12:39:42 +0000
committerJeremy Harris <jgh146exb@wizmail.org>2022-01-29 12:45:03 +0000
commit10d0e7206d88d1fb811b01e49181187579f77e9c (patch)
tree4038b2f9357f8f2cb163bc093a5134a55693a93e /src
parent8f6f8772553ebcc66418ac379d956d9af1abdc32 (diff)
Avoid null-indirection from null argv[0]
Diffstat (limited to 'src')
-rw-r--r--src/src/exim.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/src/exim.c b/src/src/exim.c
index de25b3256..c35049763 100644
--- a/src/src/exim.c
+++ b/src/src/exim.c
@@ -1690,7 +1690,7 @@ int i, rv;
int list_queue_option = 0;
int msg_action = 0;
int msg_action_arg = -1;
-int namelen = (argv[0] == NULL)? 0 : Ustrlen(argv[0]);
+int namelen = argv[0] ? Ustrlen(argv[0]) : 0;
int queue_only_reason = 0;
#ifdef EXIM_PERL
int perl_start_option = 0;
@@ -1834,6 +1834,7 @@ if (f.running_in_test_harness)
debug_store = TRUE;
/* Protect against abusive argv[0] */
+if (!argv[0] || !argc) exim_fail("exim: executable name required\n");
exim_str_fail_toolong(argv[0], PATH_MAX, "argv[0]");
/* The C standard says that the equivalent of setlocale(LC_ALL, "C") is obeyed