From 439177057c136dadfece37a8af8797762eefc922 Mon Sep 17 00:00:00 2001 From: myT Date: Fri, 4 Nov 2022 04:36:05 +0100 Subject: [PATCH] fixed FS_FileForHandle's range check --- code/qcommon/files.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/qcommon/files.cpp b/code/qcommon/files.cpp index 1913392..6109e0a 100644 --- a/code/qcommon/files.cpp +++ b/code/qcommon/files.cpp @@ -327,8 +327,8 @@ static fileHandle_t FS_HandleForFile() static FILE* FS_FileForHandle( fileHandle_t f ) { - if ( f < 0 || f > MAX_FILE_HANDLES ) { - Com_Error( ERR_DROP, "FS_FileForHandle: out of reange" ); + if ( f < 0 || f >= MAX_FILE_HANDLES ) { + Com_Error( ERR_DROP, "FS_FileForHandle: out of range" ); } if (fsh[f].zipFile == qtrue) { Com_Error( ERR_DROP, "FS_FileForHandle: can't get FILE on zip file" );