From: Jeremy Harris Date: Tue, 3 Dec 2024 19:23:13 +0000 (+0000) Subject: Arg type coercion for Ustpcpy X-Git-Url: https://git.exim.org/exim.git/commitdiff_plain/e2730b852a7ea9504008fa85878f5304dfdbd06e Arg type coercion for Ustpcpy --- diff --git a/src/src/functions.h b/src/src/functions.h index 2b77babec..74000b92f 100644 --- a/src/src/functions.h +++ b/src/src/functions.h @@ -743,8 +743,9 @@ if (!is_tainted(dst) && is_tainted(src)) die_tainted(US"Ustrncpy", CUS func, lin return US strncpy(CS dst, CCS src, n); } #if !defined(COMPILE_UTILITY) && !defined(MACRO_PREDEF) -static inline uschar * Ustpcpy(uschar * dst, const uschar * src) +static inline uschar * __Ustpcpy(uschar * dst, const uschar * src, const char * func, int line) { +if (!is_tainted(dst) && is_tainted(src)) die_tainted(US"Ustpcpy", CUS func, line); return US stpcpy(CS dst, CCS src); } #endif diff --git a/src/src/mytypes.h b/src/src/mytypes.h index 598569d00..d381f724b 100644 --- a/src/src/mytypes.h +++ b/src/src/mytypes.h @@ -147,6 +147,7 @@ functions that are called quite often; for other calls to external libraries # define Ustrcpy(s,t) __Ustrcpy(s, CUS(t), __FUNCTION__, __LINE__) # define Ustrncat(s,t,n) __Ustrncat(s, CUS(t), n, __FUNCTION__, __LINE__) # define Ustrncpy(s,t,n) __Ustrncpy(s, CUS(t), n, __FUNCTION__, __LINE__) +# define Ustpcpy(s,t) __Ustpcpy(s, CUS(t), __FUNCTION__, __LINE__) #endif #endif