X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/4bb241788d6183df9df6b11a6e6071734b65fce1..6d2c02560e5c0aa7cef83d02b26f193135b93e21:/src/src/functions.h diff --git a/src/src/functions.h b/src/src/functions.h index ba4996f42..07df8755b 100644 --- a/src/src/functions.h +++ b/src/src/functions.h @@ -2,8 +2,8 @@ * Exim - an Internet mail transport agent * *************************************************/ +/* Copyright (c) The Exim Maintainers 2020 - 2022 */ /* Copyright (c) University of Cambridge 1995 - 2018 */ -/* Copyright (c) The Exim Maintainers 2020 - 2021 */ /* See the file NOTICE for conditions of use and distribution. */ @@ -788,7 +788,10 @@ static inline uschar * string_copyn_taint_trc(const uschar * s, unsigned len, const void * proto_mem, const char * func, int line) { -uschar * ss = store_get_3(len + 1, proto_mem, func, line); +uschar * ss; +unsigned slen = Ustrlen(s); +if (len > slen) len = slen; +ss = store_get_3(len + 1, proto_mem, func, line); memcpy(ss, s, len); ss[len] = '\0'; return ss;