From 185adae2f90ed187c7c4e0d415defb35b9c78722 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 23 Aug 2005 02:05:53 +0000 Subject: r9499: added error checking to the userAuth() call. SWAT is still failing, but at least it now tells us why (This used to be commit 4afb16d7b24b1d1ed359048a89950924b363e44a) --- source4/scripting/ejs/smbcalls_auth.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source4/scripting') diff --git a/source4/scripting/ejs/smbcalls_auth.c b/source4/scripting/ejs/smbcalls_auth.c index 37ac9543cc..06d17ed01a 100644 --- a/source4/scripting/ejs/smbcalls_auth.c +++ b/source4/scripting/ejs/smbcalls_auth.c @@ -105,7 +105,7 @@ static int ejs_userAuth(MprVarHandle eid, int argc, struct MprVar **argv) const char *password; const char *domain; const char *remote_host; - struct MprVar auth, *creds_obj; + struct MprVar auth; struct cli_credentials *creds; if (argc != 1 || argv[0]->type != MPR_TYPE_OBJECT) { @@ -115,6 +115,10 @@ static int ejs_userAuth(MprVarHandle eid, int argc, struct MprVar **argv) /* get credential values from credentials object */ creds = mprGetPtr(argv[0], "creds"); + if (creds == NULL) { + ejsSetErrorMsg(eid, "userAuth requires a 'creds' element"); + return -1; + } username = cli_credentials_get_username(creds); password = cli_credentials_get_password(creds); domain = cli_credentials_get_domain(creds); -- cgit