git://git.exim.org
/
users
/
heiko
/
exim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
183c554
)
Safer handling of argument-logging memory of cwd
author
Phil Pennock
<pdp@exim.org>
Sat, 19 May 2018 16:09:55 +0000
(12:09 -0400)
committer
Phil Pennock
<pdp@exim.org>
Sat, 19 May 2018 16:10:39 +0000
(12:10 -0400)
src/src/exim.c
patch
|
blob
|
history
diff --git
a/src/src/exim.c
b/src/src/exim.c
index c21d9eb7dd482702a777cb2c3ef37615af98a4f0..810550dd509657acb04b5afef14837569ad09f87 100644
(file)
--- a/
src/src/exim.c
+++ b/
src/src/exim.c
@@
-4091,8
+4091,11
@@
if (((debug_selector & D_any) != 0 || LOGGING(arguments))
Ustrcpy(p, "cwd= (failed)");
Ustrncpy(p + 4, initial_cwd, big_buffer_size-5);
Ustrcpy(p, "cwd= (failed)");
Ustrncpy(p + 4, initial_cwd, big_buffer_size-5);
+ p += 4 + Ustrlen(initial_cwd);
+ /* in case p is near the end and we don't provide enough space for
+ * string_format to be willing to write. */
+ *p = '\0';
- while (*p) p++;
(void)string_format(p, big_buffer_size - (p - big_buffer), " %d args:", argc);
while (*p) p++;
for (i = 0; i < argc; i++)
(void)string_format(p, big_buffer_size - (p - big_buffer), " %d args:", argc);
while (*p) p++;
for (i = 0; i < argc; i++)