shithub: choc

Download patch

ref: ea59eb7140b242bfd3b13b00acb270ecda0ca1de
parent: 5941db63fff0d5793b7990ee242ac95decba0abb
author: Turo Lamminen <turotl@gmail.com>
date: Sat Jan 6 10:46:07 EST 2018

strife: Don't ignore return value of fread() call when loading savegame mission objective

--- a/src/strife/m_saves.c
+++ b/src/strife/m_saves.c
@@ -293,8 +293,12 @@
 
     if((f = fopen(srcpath, "rb")))
     {
-        fread(mission_objective, 1, OBJECTIVE_LEN, f);
+        int retval = fread(mission_objective, 1, OBJECTIVE_LEN, f);
         fclose(f);
+        if (retval != OBJECTIVE_LEN)
+        {
+            I_Error("M_ReadMisObj: error while reading mission objective");
+        }
     }
 
     Z_Free(srcpath);