git://git.exim.org
/
exim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8f6f877
)
Avoid null-indirection from null argv[0]
author
Jeremy Harris
<jgh146exb@wizmail.org>
Sat, 29 Jan 2022 12:39:42 +0000
(12:39 +0000)
committer
Jeremy Harris
<jgh146exb@wizmail.org>
Sat, 29 Jan 2022 12:45:03 +0000
(12:45 +0000)
src/src/exim.c
patch
|
blob
|
history
diff --git
a/src/src/exim.c
b/src/src/exim.c
index de25b325659b27fd2753770d04561f19fde8d8cf..c35049763050795b3767c131a9ddfcdf97810380 100644
(file)
--- 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 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;
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] */
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
exim_str_fail_toolong(argv[0], PATH_MAX, "argv[0]");
/* The C standard says that the equivalent of setlocale(LC_ALL, "C") is obeyed