From aa8aaefa0607f60bff17736b5a30e1029f499882 Mon Sep 17 00:00:00 2001 From: Jack Arthur Harrhy Date: Sun, 5 Apr 2026 15:47:24 -0400 Subject: [PATCH 1/2] Remove stale vresWidth/vresHeight override in GLimp_SetMode vresWidth and vresHeight were correctly set to glConfig.vidWidth/vidHeight but then immediately overwritten with hardcoded 640x480 values. This causes a resolution mismatch between the actual window size and what the renderer believes the virtual resolution to be. --- code/sdl/sdl_glimp.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/code/sdl/sdl_glimp.c b/code/sdl/sdl_glimp.c index a5d427a5ae..76b8482471 100644 --- a/code/sdl/sdl_glimp.c +++ b/code/sdl/sdl_glimp.c @@ -630,12 +630,6 @@ static int GLimp_SetMode(int mode, qboolean fullscreen, qboolean noborder) vresWidth = glConfig.vidWidth; vresHeight = glConfig.vidHeight; - - - - vresWidth = 640; - vresHeight = 480; - #if SDL_MAJOR_VERSION != 2 screen = vidscreen; #endif From 12eabc5ddd62c9d7d2d30f1ebc414ade3b32a3b5 Mon Sep 17 00:00:00 2001 From: Jack Arthur Harrhy Date: Sun, 5 Apr 2026 15:47:30 -0400 Subject: [PATCH 2/2] Use memmove for CG_STRNCPY VM syscall The Q3VM cgame module can pass overlapping src/dst pointers to CG_STRNCPY since both point into the same VM memory buffer. strncpy does not support overlapping buffers and modern hardened libc implementations (e.g. macOS) trap on the overlap, crashing the client on map load. memmove handles overlapping regions correctly. --- code/client/cl_cgame.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/client/cl_cgame.c b/code/client/cl_cgame.c index 9d86e97176..f6fb73371f 100644 --- a/code/client/cl_cgame.c +++ b/code/client/cl_cgame.c @@ -618,7 +618,7 @@ intptr_t CL_CgameSystemCalls( intptr_t *args ) { Com_Memcpy( VMA(1), VMA(2), args[3] ); return 0; case CG_STRNCPY: - strncpy( VMA(1), VMA(2), args[3] ); + memmove( VMA(1), VMA(2), args[3] ); return args[1]; case CG_SIN: return FloatAsInt( sin( VMF(1) ) );