diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-07-19 11:52:50 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:29:43 -0500 |
commit | cd65f29fc68eb51d0ca7e3c598f875d2c9eafc35 (patch) | |
tree | 863af61c82d7f9900ca40e57c3a092b1b017bcc8 /source4 | |
parent | 325edaa66a5b3a8c907a3a521b4ceea26ea0210c (diff) | |
download | samba-cd65f29fc68eb51d0ca7e3c598f875d2c9eafc35.tar.gz samba-cd65f29fc68eb51d0ca7e3c598f875d2c9eafc35.tar.bz2 samba-cd65f29fc68eb51d0ca7e3c598f875d2c9eafc35.zip |
r8599: null terminate the argv list in string C functions
(This used to be commit cabf638a31ab5f9b0e62e085d844d615c597bc2f)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/lib/appweb/ejs/ejsParser.c | 3 |
1 files changed, 2 insertions, 1 deletions
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; } |