Explorar o código

[text] TextLength() security check

Ray %!s(int64=5) %!d(string=hai) anos
pai
achega
39e73ccc4d
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  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;
 }