[dovecot-cvs] dovecot/src/imap-login client-authenticate.c, 1.41, 1.42

cras at dovecot.org cras at dovecot.org
Sat Jun 17 22:48:41 EEST 2006


Update of /var/lib/cvs/dovecot/src/imap-login
In directory talvi:/tmp/cvs-serv17808

Modified Files:
	client-authenticate.c 
Log Message:
Don't crash if the initial response isn't given for AUTHENTICATE..



Index: client-authenticate.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap-login/client-authenticate.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- client-authenticate.c	17 Jun 2006 17:19:33 -0000	1.41
+++ client-authenticate.c	17 Jun 2006 19:48:36 -0000	1.42
@@ -233,7 +233,7 @@
 
 int cmd_authenticate(struct imap_client *client, struct imap_arg *args)
 {
-	const char *mech_name;
+	const char *mech_name, *init_resp = NULL;
 
 	/* we want only one argument: authentication mechanism name */
 	if (args[0].type != IMAP_ARG_ATOM && args[0].type != IMAP_ARG_STRING)
@@ -243,6 +243,7 @@
 		if (args[1].type != IMAP_ARG_ATOM ||
 		    args[2].type != IMAP_ARG_EOL)
 			return -1;
+		init_resp = IMAP_ARG_STR(&args[1]);
 	}
 
 	mech_name = IMAP_ARG_STR(&args[0]);
@@ -251,7 +252,7 @@
 
 	client_ref(client);
 	sasl_server_auth_begin(&client->common, "IMAP", mech_name,
-			       IMAP_ARG_STR(&args[1]), sasl_callback);
+			       init_resp, sasl_callback);
 	if (!client->common.authenticating)
 		return 1;
 



More information about the dovecot-cvs mailing list