From 843c9abf9b0572e0368891eb7d28c2822265c7ec Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Wed, 25 May 2022 03:38:19 +0300 Subject: [PATCH] engine: common: fix array underrun --- engine/common/host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/common/host.c b/engine/common/host.c index 07fbfd55..9b0c6285 100644 --- a/engine/common/host.c +++ b/engine/common/host.c @@ -1008,7 +1008,7 @@ void Host_InitCommon( int argc, char **argv, const char *progname, qboolean bCha len = Q_strlen( host.rootdir ); - if( host.rootdir[len - 1] == '/' ) + if( len && host.rootdir[len - 1] == '/' ) host.rootdir[len - 1] = 0; // get readonly root. The order is: check for arg, then env.