Commit 88db66c5 authored by David Lawrence's avatar David Lawrence

Bug 1044701: "Uninitialized value $token_type" when passing an invalid Bugzilla_api_token value

r=sgreen,a=glob
parent 8770b2cb
......@@ -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 });
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment