From d9db975b4b5a2d31332ad9f60672156984c905e9 Mon Sep 17 00:00:00 2001 From: Frank Praznik Date: Wed, 21 May 2025 20:36:44 -0400 Subject: [PATCH] wayland: Use SDL_memcpy instead of SDL_copyp to copy the repeated text string SDL_copyp is not intended to copy arrays. Use SDL_memcpy with the explicit size instead. (cherry picked from commit abcfa1b7de9abbf3eb80fcc6ff9a5efc5caac418) --- src/video/wayland/SDL_waylandevents.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video/wayland/SDL_waylandevents.c b/src/video/wayland/SDL_waylandevents.c index 2736389a67..5111908a0b 100644 --- a/src/video/wayland/SDL_waylandevents.c +++ b/src/video/wayland/SDL_waylandevents.c @@ -317,7 +317,7 @@ static void keyboard_repeat_set(SDL_WaylandKeyboardRepeat *repeat_info, Uint32 k repeat_info->next_repeat_ns = SDL_MS_TO_NS(repeat_info->repeat_delay_ms); repeat_info->scancode = scancode; if (has_text) { - SDL_copyp(repeat_info->text, text); + SDL_memcpy(repeat_info->text, text, sizeof(repeat_info->text)); } else { repeat_info->text[0] = '\0'; }