src/fcfreetype.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 91a57074652872353ded6aa74fe54213056daf40 Author: Akira TAGOH <akira@xxxxxxxxx> Date: Thu Dec 14 18:06:40 2023 +0900 Use memmove instead of memcpy POSIX and C standards says that using memcpy() for overlapping areas produces undefined behavior. Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/397 diff --git a/src/fcfreetype.c b/src/fcfreetype.c index da7da83..c4c2637 100644 --- a/src/fcfreetype.c +++ b/src/fcfreetype.c @@ -1741,7 +1741,7 @@ FcFreeTypeQueryFaceInternal (const FT_Face face, goto bail1; len = strlen ((const char *) style); for (i = 0; style[i] != 0 && isspace (style[i]); i++); - memcpy (style, &style[i], len - i); + memmove (style, &style[i], len - i); FcStrBufInit (&sbuf, NULL, 0); FcStrBufString (&sbuf, family); FcStrBufChar (&sbuf, ' ');