Pārlūkot izejas kodu

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

pull/3798/head
Mingjie Shen pirms 1 gada
committed by GitHub
vecāks
revīzija
6280771dad
Šim parakstam datu bāzē netika atrasta zināma atslēga GPG atslēgas ID: B5690EEEBB952194
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. +1
    -1
      src/rtext.c

+ 1
- 1
src/rtext.c Parādīt failu

@ -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;

Notiek ielāde…
Atcelt
Saglabāt