From c07e0452c770ae446e0d22826597ab1315cc13ee Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 17 May 2025 18:25:41 +0200 Subject: [PATCH] fix overflow due to too small name array size in fscan in model init --- src/hardware/hw_md2.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index 7a49edcb8..0a330ba15 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -495,7 +495,10 @@ void HWR_InitModels(void) size_t i; INT32 s; FILE *f; - char name[24], filename[32]; + char name[26], filename[32]; + // name[24] is used to check for names in the models.dat file that match with sprites or player skins + // sprite names are always 4 characters long, and names is for player skins can be up to 19 characters long + // PLAYERMODELPREFIX is 6 characters long float scale, offset; size_t prefixlen;