[exim-cvs] Safer handling of argument-logging memory of cwd

Top Page
Delete this message
Reply to this message
Author: Exim Git Commits Mailing List
Date:  
To: exim-cvs
Subject: [exim-cvs] Safer handling of argument-logging memory of cwd
Gitweb: https://git.exim.org/exim.git/commitdiff/805fd869d551c36d1d77ab2b292a7008d643ca79
Commit:     805fd869d551c36d1d77ab2b292a7008d643ca79
Parent:     183c55432641afe63f9fdacd0461fb2e8d80d0dc
Author:     Phil Pennock <pdp@???>
AuthorDate: Sat May 19 12:09:55 2018 -0400
Committer:  Phil Pennock <pdp@???>
CommitDate: Sat May 19 12:10:39 2018 -0400


    Safer handling of argument-logging memory of cwd
---
 src/src/exim.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)


diff --git a/src/src/exim.c b/src/src/exim.c
index c21d9eb..810550d 100644
--- 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);
+ 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++)