]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: Make static analyzer happier.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 2 Nov 2016 21:00:50 +0000 (23:00 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 9 Nov 2016 12:30:16 +0000 (14:30 +0200)
Don't complain about uninitialized static_password being sent to
passdb_handle_credentials(). It could only happen for failures, and
passdb_handle_credentials() wouldn't have used the password then.

src/auth/passdb-static.c

index 631b967c894fe96166bdb65a4803b62c83a2a093..440d70899c79b0dd757364ae8a988489a3a58bb9 100644 (file)
@@ -17,6 +17,9 @@ static_save_fields(struct auth_request *request, const char **password_r, const
        struct static_passdb_module *module =
                (struct static_passdb_module *)request->passdb->passdb;
 
+       *password_r = NULL;
+       *scheme_r = NULL;
+
        auth_request_log_debug(request, AUTH_SUBSYS_DB, "lookup");
        passdb_template_export(module->tmpl, request);
 
@@ -28,8 +31,6 @@ static_save_fields(struct auth_request *request, const char **password_r, const
        } else {
                auth_request_log_info(request, AUTH_SUBSYS_DB,
                        "No password returned (and no nopassword)");
-               *password_r = NULL;
-               *scheme_r = NULL;
                return PASSDB_RESULT_PASSWORD_MISMATCH;
        }