[rtext] Change strcpy to strncpy to fix buffer overflow (#3795)
This commit is contained in:
parent
4cd71a9750
commit
6280771dad
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue