From f10ea8e6309fe68c5c0557b1f97ff91d03d2849b Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Sun, 22 Dec 2019 10:20:26 +0000 Subject: [PATCH] Add check against MAXVOXELS in qloadkvx git-svn-id: https://svn.eduke32.com/eduke32@8472 1a8010ca-5511-0410-912e-c29ae57300e0 # Conflicts: # source/build/src/engine.cpp --- source/build/src/engine.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index ce07b885b..7fb996d04 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -10157,6 +10157,9 @@ void videoNextPage(void) int32_t qloadkvx(int32_t voxindex, const char *filename) { + if ((unsigned)voxindex >= MAXVOXELS) + return -1; + auto fil = fileSystem.OpenFileReader(filename, 0); if (!fil.isOpen()) return -1;