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=refs%2Fmerge-requests%2F161%2Fhead;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" );