From: andy Date: Wed, 1 Aug 2007 22:46:12 +0000 (+0000) Subject: Melchior discovered that call(call) would crash due to a longstanding bug with argume... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5da33ca244873bdd336dafcab7e04b661bd76e71;p=simgear.git Melchior discovered that call(call) would crash due to a longstanding bug with argument parsing --- diff --git a/simgear/nasal/lib.c b/simgear/nasal/lib.c index a724d5cb..f7ce44e4 100644 --- a/simgear/nasal/lib.c +++ b/simgear/nasal/lib.c @@ -224,7 +224,7 @@ static naRef f_call(naContext c, naRef me, int argc, naRef* args) callns = argc > 3 ? args[3] : naNil(); // ditto if(!IS_HASH(callme)) callme = naNil(); if(!IS_HASH(callns)) callns = naNil(); - if(!IS_FUNC(args[0]) || (!IS_NIL(callargs) && !IS_VEC(callargs))) + if(argc==0 || !IS_FUNC(args[0]) || (!IS_NIL(callargs) && !IS_VEC(callargs))) ARGERR(); subc = naSubContext(c);