From: Timo Sirainen Date: Wed, 26 Feb 2003 21:27:17 +0000 (+0200) Subject: Invalid PLAIN auth request crashed auth process. X-Git-Tag: 1.1.alpha1~4844 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0fda2dfa8c91818085202f278ab913cc9e9bf8f1;p=thirdparty%2Fdovecot%2Fcore.git Invalid PLAIN auth request crashed auth process. --HG-- branch : HEAD --- diff --git a/src/auth/mech-plain.c b/src/auth/mech-plain.c index 7ecb826cc0..87549c1e1f 100644 --- a/src/auth/mech-plain.c +++ b/src/auth/mech-plain.c @@ -42,12 +42,17 @@ mech_plain_auth_continue(struct auth_request *auth_request, } } - /* split and save user/realm */ - auth_request->user = p_strdup(auth_request->pool, authenid); - passdb->verify_plain(auth_request, pass, verify_callback); + if (authenid == NULL) { + /* invalid input */ + mech_auth_finish(auth_request, NULL, 0, FALSE); + } else { + /* split and save user/realm */ + auth_request->user = p_strdup(auth_request->pool, authenid); + passdb->verify_plain(auth_request, pass, verify_callback); - /* make sure it's cleared */ - safe_memset(pass, 0, strlen(pass)); + /* make sure it's cleared */ + safe_memset(pass, 0, strlen(pass)); + } return TRUE; }