From 5da33ca244873bdd336dafcab7e04b661bd76e71 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 1 Aug 2007 22:46:12 +0000 Subject: [PATCH] Melchior discovered that call(call) would crash due to a longstanding bug with argument parsing --- simgear/nasal/lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.39.5