From cd65f29fc68eb51d0ca7e3c598f875d2c9eafc35 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 19 Jul 2005 11:52:50 +0000 Subject: r8599: null terminate the argv list in string C functions (This used to be commit cabf638a31ab5f9b0e62e085d844d615c597bc2f) --- source4/lib/appweb/ejs/ejsParser.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source4/lib/appweb') diff --git a/source4/lib/appweb/ejs/ejsParser.c b/source4/lib/appweb/ejs/ejsParser.c index 452e7fde8f..e7c44f4d6c 100644 --- a/source4/lib/appweb/ejs/ejsParser.c +++ b/source4/lib/appweb/ejs/ejsParser.c @@ -2003,10 +2003,11 @@ static int evalFunction(Ejs *ep, MprVar *obj, int flags) case MPR_TYPE_STRING_CFUNCTION: if (actualArgs->used > 0) { - argBuf = mprMalloc(actualArgs->used * sizeof(char*)); + argBuf = mprMalloc((1+actualArgs->used) * sizeof(char*)); for (i = 0; i < actualArgs->used; i++) { mprVarToString(&argBuf[i], MPR_MAX_STRING, 0, argValues[i]); } + argBuf[i] = NULL; } else { argBuf = 0; } -- cgit