]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: Ensure username can't be left unset in APOP
authorAki Tuomi <aki.tuomi@dovecot.fi>
Tue, 16 Aug 2016 11:46:08 +0000 (14:46 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 17 Aug 2016 15:24:02 +0000 (18:24 +0300)
Makes static analysers happy

src/auth/mech-apop.c

index 4c7a530876a1622dfe26d97e1199b84a717b54e0..aed248d49fd20026d7a1c92ec6c6b0470dc6ea6b 100644 (file)
@@ -101,6 +101,12 @@ mech_apop_auth_initial(struct auth_request *auth_request,
                username = ++tmp;
                while (tmp != end && *tmp != '\0')
                        tmp++;
+       } else {
+               /* should never happen */
+               auth_request_log_info(auth_request, AUTH_SUBSYS_MECH,
+                       "malformed data");
+               auth_request_fail(auth_request);
+               return;
        }
 
        if (tmp + 1 + 16 != end) {