[exim-cvs] avoid modifying source text, in appendfile

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Exim Git Commits Mailing List
Datum:  
To: exim-cvs
Betreff: [exim-cvs] avoid modifying source text, in appendfile
Gitweb: https://git.exim.org/exim.git/commitdiff/394eb1aa097bf00993b6625a5a27405dac9bf43d
Commit:     394eb1aa097bf00993b6625a5a27405dac9bf43d
Parent:     48cf5ff9f3b4aee78f670b636e48183730fb6b76
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Sat May 15 00:19:26 2021 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Mon Jun 28 00:30:02 2021 +0100


    avoid modifying source text, in appendfile
---
 src/src/transports/appendfile.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)


diff --git a/src/src/transports/appendfile.c b/src/src/transports/appendfile.c
index 5d957b6..2d008d9 100644
--- a/src/src/transports/appendfile.c
+++ b/src/src/transports/appendfile.c
@@ -1368,8 +1368,8 @@ if (!isdirectory)
   if (ob->create_directory && allow_creation_here)
     {
     uschar *p = Ustrrchr(path, '/');
-    *p = '\0';
-    if (!directory_make(NULL, path, ob->dirmode, FALSE))
+    p = string_copyn(path, p - path);
+    if (!directory_make(NULL, p, ob->dirmode, FALSE))
       {
       addr->basic_errno = errno;
       addr->message =
@@ -1378,7 +1378,6 @@ if (!isdirectory)
       DEBUG(D_transport) debug_printf("%s transport: %s\n", tblock->name, path);
       return FALSE;
       }
-    *p = '/';
     }


/* If file_format is set we must check that any existing file matches one of