Selaa lähdekoodia

[text] TextLength() security check

Ray 5 vuotta sitten
vanhempi
commit
39e73ccc4d
1 muutettua tiedostoa jossa 4 lisäystä ja 1 poistoa
  1. 4 1
      src/text.c

+ 4 - 1
src/text.c

@@ -1147,7 +1147,10 @@ unsigned int TextLength(const char *text)
 {
     unsigned int length = 0; //strlen(text)
 
-    while (*text++) length++;
+    if (text != NULL)
+    {
+        while (*text++) length++;
+    }
 
     return length;
 }