From: Thomas Debesse Date: Fri, 27 Mar 2020 00:52:28 +0000 (+0100) Subject: q3map2: fix segfault when missing bspfile arg on light stage X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d0ddc5a3a4e1de4436c2c0d2650a9cc6f4643f10;p=xonotic%2Fnetradiant.git q3map2: fix segfault when missing bspfile arg on light stage --- 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" );