summaryrefslogtreecommitdiffhomepage
path: root/src/text.c
diff options
context:
space:
mode:
authorRay <[email protected]>2020-02-17 00:47:05 +0100
committerRay <[email protected]>2020-02-17 00:47:05 +0100
commit39e73ccc4d1a09c5276b2a575a65081002a1143c (patch)
tree220f657112d556fed83a1d54b70e95ad679b6d61 /src/text.c
parentdf4b55d657ebae239d01abd1966602d735a19244 (diff)
downloadraylib-39e73ccc4d1a09c5276b2a575a65081002a1143c.tar.gz
raylib-39e73ccc4d1a09c5276b2a575a65081002a1143c.zip
[text] TextLength() security check
Diffstat (limited to 'src/text.c')
-rw-r--r--src/text.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/text.c b/src/text.c
index f8300d61..074fcdb2 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;
}