X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/18eacc1185bea956bd9c793ab34e582c08941799..fa1c8faf169384bebaa8d172f491574c45ae2aa4:/src/src/spool_in.c diff --git a/src/src/spool_in.c b/src/src/spool_in.c index 1fcff954f..3e3b246ab 100644 --- a/src/src/spool_in.c +++ b/src/src/spool_in.c @@ -2,7 +2,7 @@ * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) The Exim Maintainers 2020 - 2022 */ +/* Copyright (c) The Exim Maintainers 2020 - 2023 */ /* Copyright (c) University of Cambridge 1995 - 2018 */ /* See the file NOTICE for conditions of use and distribution. */ /* SPDX-License-Identifier: GPL-2.0-or-later */ @@ -36,7 +36,7 @@ Side effect: message_subdir is set for the (possibly split) spool directory */ int -spool_open_datafile(uschar * id) +spool_open_datafile(const uschar * id) { struct stat statbuf; flock_t lock_data; @@ -456,9 +456,12 @@ n = Ustrlen(big_buffer); if (n < 3 || big_buffer[0] != '<' || big_buffer[n-2] != '>') goto SPOOL_FORMAT_ERROR; -sender_address = store_get(n-2, GET_TAINTED); -Ustrncpy(sender_address, big_buffer+1, n-3); -sender_address[n-3] = 0; + { + uschar * s = store_get(n-2, GET_TAINTED); + Ustrncpy(s, big_buffer+1, n-3); + s[n-3] = '\0'; + sender_address = s; + } where = US"time"; if (Ufgets(big_buffer, big_buffer_size, fp) == NULL) goto SPOOL_READ_ERROR;