From bced620da3796a796d1d192c301ca99b5b7bd1b0 Mon Sep 17 00:00:00 2001 From: Rafael Barreto Date: Mon, 10 May 2010 21:50:38 +0000 Subject: [PATCH] more secure... i am sure that wizardmain cannot be called without --wizard, but who knows the mods people will do in the future... git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4829 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/wizard.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/src/wizard.cpp b/source/src/wizard.cpp index b5b7e70b..1235ab2d 100644 --- a/source/src/wizard.cpp +++ b/source/src/wizard.cpp @@ -29,8 +29,10 @@ int wizardmain(int argc, char **argv) } /* You will never now what server.sh script will really place before --wizard */ - int i = 0; - while (strncmp(argv[i],"--wizard",8)) i++; + int k, i = 0; + while ( ( k = strncmp(argv[i],"--wizard",8) ) != 0 && i < 20 ) i++; + if ( k != 0 ) return EXIT_FAILURE; + string outfile(argv[++i]); string relpath(argv[++i]);