From: Mike Yuan Date: Sat, 25 Oct 2025 17:29:33 +0000 (+0200) Subject: strxcpyx: do not access dest as an array X-Git-Tag: v259-rc1~241^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a181a9192b10317ec62d902d5c4d6d24aec591e1;p=thirdparty%2Fsystemd.git strxcpyx: do not access dest as an array dest is a pointer to a string, not an array. Accessing the "first element" just happens to work, but let's be more careful. --- diff --git a/src/basic/strxcpyx.c b/src/basic/strxcpyx.c index 9126e1dfe26..dc40d620e7e 100644 --- a/src/basic/strxcpyx.c +++ b/src/basic/strxcpyx.c @@ -41,7 +41,7 @@ size_t strnpcpy_full(char **dest, size_t size, const char *src, size_t len, bool if (ret_truncated) *ret_truncated = truncated; - *dest[0] = '\0'; + (*dest)[0] = '\0'; return size; }