r8633: check for valid input to ejs_userAuth()
[bbaumbach/samba-autobuild/.git] / source4 / scripting / ejs / smbcalls_auth.c
index 4739922e38c69790d34c10e401c14c54accb0257..87d5327e04f2c7c19af34c51d2f1bf3aa6d2caba 100644 (file)
@@ -102,6 +102,11 @@ static int ejs_userAuth(MprVarHandle eid, int argc, struct MprVar **argv)
        domain = mprToString(mprGetProperty(argv[0], "domain", NULL));
        remote_host = mprToString(mprGetProperty(argv[0], "rhost", NULL));
 
+       if (username == NULL || password == NULL || domain == NULL) {
+               mpr_Return(eid, mprCreateUndefinedVar());
+               return 0;
+       }
+
        tmp_ctx = talloc_new(mprMemCtx());      
        auth = mprObject("auth");