From 6280771dad01c03fa63eac0328dc4ff4710deda9 Mon Sep 17 00:00:00 2001 From: Mingjie Shen Date: Tue, 13 Feb 2024 04:38:13 -0500 Subject: [PATCH] [rtext] Change strcpy to strncpy to fix buffer overflow (#3795) --- src/rtext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rtext.c b/src/rtext.c index 7a1256221..ba09c7098 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -530,7 +530,7 @@ Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int Font font = { 0 }; char fileExtLower[16] = { 0 }; - strcpy(fileExtLower, TextToLower(fileType)); + strncpy(fileExtLower, TextToLower(fileType), sizeof(fileExtLower) - 1); font.baseSize = fontSize; font.glyphCount = (codepointCount > 0)? codepointCount : 95;