svn commit: samba r8599 - in branches/SAMBA_4_0/source/lib/appweb/ejs: .

tridge at samba.org tridge at samba.org
Tue Jul 19 11:52:50 GMT 2005


Author: tridge
Date: 2005-07-19 11:52:50 +0000 (Tue, 19 Jul 2005)
New Revision: 8599

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=8599

Log:
null terminate the argv list in string C functions




Modified:
   branches/SAMBA_4_0/source/lib/appweb/ejs/ejsParser.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/appweb/ejs/ejsParser.c
===================================================================
--- branches/SAMBA_4_0/source/lib/appweb/ejs/ejsParser.c	2005-07-19 11:06:12 UTC (rev 8598)
+++ branches/SAMBA_4_0/source/lib/appweb/ejs/ejsParser.c	2005-07-19 11:52:50 UTC (rev 8599)
@@ -2003,10 +2003,11 @@
 
 	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;
 		}



More information about the samba-cvs mailing list