Selaa lähdekoodia

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

pull/3798/head
Mingjie Shen 1 vuosi sitten
committed by GitHub
vanhempi
commit
6280771dad
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. +1
    -1
      src/rtext.c

+ 1
- 1
src/rtext.c Näytä tiedosto

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

Ladataan…
Peruuta
Tallenna