소스 검색

[text] TextLength() security check

Ray 5 년 전
부모
커밋
39e73ccc4d
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  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;
 }