mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-06 03:18:14 +00:00
[rtext] Change strcpy to strncpy to fix buffer overflow (#3795)
This commit is contained in:
@@ -530,7 +530,7 @@ Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int
|
|||||||
Font font = { 0 };
|
Font font = { 0 };
|
||||||
|
|
||||||
char fileExtLower[16] = { 0 };
|
char fileExtLower[16] = { 0 };
|
||||||
strcpy(fileExtLower, TextToLower(fileType));
|
strncpy(fileExtLower, TextToLower(fileType), sizeof(fileExtLower) - 1);
|
||||||
|
|
||||||
font.baseSize = fontSize;
|
font.baseSize = fontSize;
|
||||||
font.glyphCount = (codepointCount > 0)? codepointCount : 95;
|
font.glyphCount = (codepointCount > 0)? codepointCount : 95;
|
||||||
|
Reference in New Issue
Block a user