shithub: choc

Download patch

ref: 2880809db91aed07cf5dedbf8a5aeeea76e51a6f
parent: 4127fabfb33035fba382afdd1f608db099af0835
parent: a3d41baca4d77441fa55b1d8f9963004667068d0
author: Simon Howard <fraggle+github@gmail.com>
date: Wed Jan 23 10:01:30 EST 2019

Merge pull request #1129 from mfrancis95/master

Apply @fabiangreffrath's patch to fix a memory error in Hexen

--- a/src/hexen/sc_man.c
+++ b/src/hexen/sc_man.c
@@ -195,13 +195,8 @@
     }
     while (foundToken == false)
     {
-        while (*ScriptPtr <= 32)
+        while (ScriptPtr < ScriptEndPtr && *ScriptPtr <= 32)
         {
-            if (ScriptPtr >= ScriptEndPtr)
-            {
-                sc_End = true;
-                return false;
-            }
             if (*ScriptPtr++ == '\n')
             {
                 sc_Line++;