From fadd74358b006de84c94315fdbaf8d7d16af0096 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 26 Feb 2020 23:38:12 +0100 Subject: [PATCH] Security check --- src/rlgl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rlgl.h b/src/rlgl.h index ce6fdaf5..03aaf625 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -3004,7 +3004,7 @@ char *LoadText(const char *fileName) { text = (char *)RL_MALLOC(sizeof(char)*(size + 1)); int count = fread(text, sizeof(char), size, textFile); - text[count] = '\0'; + if (size == count) text[count] = '\0'; } fclose(textFile);