]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: Check for NULL auth token
authorAki Tuomi <aki.tuomi@dovecot.fi>
Tue, 16 Aug 2016 11:36:07 +0000 (14:36 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 17 Aug 2016 15:23:26 +0000 (18:23 +0300)
Makes static analysers happy

src/auth/mech-dovecot-token.c

index a940d53518b293ffba73931a0d7a14ef0392ca02..8f63e028d8f6a17315338b49039d8f710e58af24 100644 (file)
@@ -51,7 +51,8 @@ mech_dovecot_token_auth_continue(struct auth_request *request,
                const char *valid_token =
                        auth_token_get(service, pid, request->user, session_id);
 
-               if (strcmp(auth_token, valid_token) == 0) {
+               if (auth_token != NULL &&
+                   strcmp(auth_token, valid_token) == 0) {
                        request->passdb_success = TRUE;
                        auth_request_success(request, NULL, 0);
                } else {