]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1044701: "Uninitialized value $token_type" when passing an invalid Bugzilla_api_t...
authorDavid Lawrence <dkl@mozilla.com>
Thu, 31 Jul 2014 17:09:53 +0000 (17:09 +0000)
committerDavid Lawrence <dkl@mozilla.com>
Thu, 31 Jul 2014 17:09:53 +0000 (17:09 +0000)
r=sgreen,a=glob

Bugzilla/Auth/Login/Cookie.pm

index 9c18903b69739c65decc12daf2af6829d49ec079..e3ba98183761a64c82c0354de49133bf7f64f08b 100644 (file)
@@ -57,7 +57,10 @@ sub get_login_info {
             my $api_token = Bugzilla->input_params->{Bugzilla_api_token};
             my ($token_user_id, undef, undef, $token_type)
                 = Bugzilla::Token::GetTokenData($api_token);
-            if ($token_type ne 'api_token' || $user_id != $token_user_id) {
+            if (!defined $token_type
+                || $token_type ne 'api_token'
+                || $user_id != $token_user_id)
+            {
                 ThrowUserError('auth_invalid_token', { token => $api_token });
             }
         }