From: Jeremy Harris Date: Fri, 14 May 2021 23:19:26 +0000 (+0100) Subject: avoid modifying source text, in appendfile X-Git-Tag: exim-4.95-RC0~10^2~13 X-Git-Url: https://git.exim.org/exim.git/commitdiff_plain/394eb1aa097bf00993b6625a5a27405dac9bf43d avoid modifying source text, in appendfile --- diff --git a/src/src/transports/appendfile.c b/src/src/transports/appendfile.c index 5d957b62e..2d008d97d 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