From 39e73ccc4d1a09c5276b2a575a65081002a1143c Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 17 Feb 2020 00:47:05 +0100 Subject: [PATCH] [text] TextLength() security check --- src/text.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/text.c b/src/text.c index f8300d616..074fcdb2b 100644 --- a/src/text.c +++ b/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; }