From d0ddc5a3a4e1de4436c2c0d2650a9cc6f4643f10 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Fri, 27 Mar 2020 01:52:28 +0100 Subject: [PATCH] q3map2: fix segfault when missing bspfile arg on light stage --- tools/quake3/q3map2/light.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/quake3/q3map2/light.c b/tools/quake3/q3map2/light.c index e43906e0..79098148 100644 --- a/tools/quake3/q3map2/light.c +++ b/tools/quake3/q3map2/light.c @@ -2981,6 +2981,11 @@ int LightMain( int argc, char **argv ){ Sys_Printf( "Restricted lightmap searching enabled - block size adjusted to %d\n", lightmapSearchBlockSize ); } + /* arg checking */ + if ( i != ( argc - 1 ) ) { + Error( "usage: q3map -light [options] " ); + } + strcpy( source, ExpandArg( argv[ i ] ) ); StripExtension( source ); DefaultExtension( source, ".map" ); -- 2.39.2