summaryrefslogtreecommitdiff
path: root/source4/lib/appweb/ejs-2.0/ejs/ejsCmd.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-07-19 04:00:32 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:01:11 -0500
commitf8219ec5a8502975f347323900ff3245ff5222dc (patch)
treeb80a2683164ccf4c7da7188c010abc340fd5f639 /source4/lib/appweb/ejs-2.0/ejs/ejsCmd.c
parent3c097f3afb51f41abe2be6a5698dabba559b75fc (diff)
downloadsamba-f8219ec5a8502975f347323900ff3245ff5222dc.tar.gz
samba-f8219ec5a8502975f347323900ff3245ff5222dc.tar.bz2
samba-f8219ec5a8502975f347323900ff3245ff5222dc.zip
r23961: Allow SWAT to operate on x86_64 machines.
On machines with a 4 byte int, and a 8 byte pointer, the ESP could would fail. The problem is that 0 != NULL. 0 is an int (4 bytes) and NULL is a pointer (8), and this matters critically to varargs functions. If a 0 was passed as the 'terminating' argument, then only 4 bytes would be written to the stack, but va_arg(ap, char *) would try and pull 8, reading uninitalised memory. Andrew Bartlett (This used to be commit 72ca8e3b2a45179b731790e6329b978b22ac1ec0)
Diffstat (limited to 'source4/lib/appweb/ejs-2.0/ejs/ejsCmd.c')
-rw-r--r--source4/lib/appweb/ejs-2.0/ejs/ejsCmd.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source4/lib/appweb/ejs-2.0/ejs/ejsCmd.c b/source4/lib/appweb/ejs-2.0/ejs/ejsCmd.c
index b5279c949a..74b57de4d0 100644
--- a/source4/lib/appweb/ejs-2.0/ejs/ejsCmd.c
+++ b/source4/lib/appweb/ejs-2.0/ejs/ejsCmd.c
@@ -167,10 +167,10 @@ int main(int argc, char *argv[])
i = 0;
commandLine = 0;
len = mprAllocStrcat(MPR_LOC_ARGS(app), &commandLine, 0, " ",
- mprGetBaseName(argv[i++]), 0);
+ mprGetBaseName(argv[i++]), NULL);
for (; i < argc; i++) {
len = mprReallocStrcat(MPR_LOC_ARGS(app), &commandLine, 0, len,
- " ", argv[i], 0);
+ " ", argv[i], NULL);
}
mprPrintf(app, " %s\n", commandLine);
}
@@ -339,7 +339,7 @@ static char *readCmd(MprApp *app, FILE *input)
line[len - 1] = '\0';
}
cmdLen = mprReallocStrcat(MPR_LOC_ARGS(app), &cmd, EJS_MAX_SCRIPT,
- cmdLen, 0, line, 0);
+ cmdLen, 0, line, NULL);
}
return cmd;
}
@@ -380,12 +380,12 @@ static int interactiveUse(MprApp *app, Ejs *ejs, FILE *input, char *fileName)
if (line[len - 1] == '\\') {
line[len - 1] = '\0';
cmdLen = mprReallocStrcat(MPR_LOC_ARGS(app), &cmd, EJS_MAX_SCRIPT,
- cmdLen, 0, line, 0);
+ cmdLen, 0, line, NULL);
} else {
cmdLen = mprReallocStrcat(MPR_LOC_ARGS(app), &cmd, EJS_MAX_SCRIPT,
- cmdLen, 0, line, 0);
+ cmdLen, 0, line, NULL);
if (traceCmds) {