瀏覽代碼

[rtext] Change strcpy to strncpy to fix buffer overflow (#3795)

pull/3798/head
Mingjie Shen 10 月之前
committed by GitHub
父節點
當前提交
6280771dad
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: B5690EEEBB952194
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. +1
    -1
      src/rtext.c

+ 1
- 1
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;

Loading…
取消
儲存