diff options
| author | Mingjie Shen <[email protected]> | 2024-02-13 04:38:13 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-02-13 10:38:13 +0100 |
| commit | 6280771dad01c03fa63eac0328dc4ff4710deda9 (patch) | |
| tree | 80105ab0c22fb1797e48664b3f8b554d57ce013e /src/rtext.c | |
| parent | 4cd71a975086fa3be3b28d765e45c4bb7dc4e101 (diff) | |
| download | raylib-6280771dad01c03fa63eac0328dc4ff4710deda9.tar.gz raylib-6280771dad01c03fa63eac0328dc4ff4710deda9.zip | |
[rtext] Change strcpy to strncpy to fix buffer overflow (#3795)
Diffstat (limited to 'src/rtext.c')
| -rw-r--r-- | src/rtext.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rtext.c b/src/rtext.c index 7a125622..ba09c709 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; |
