From 88db66c588e8c411daffb13b53e4a1f5f259dc48 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Thu, 31 Jul 2014 17:09:53 +0000 Subject: Bug 1044701: "Uninitialized value $token_type" when passing an invalid Bugzilla_api_token value r=sgreen,a=glob --- Bugzilla/Auth/Login/Cookie.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Bugzilla/Auth/Login/Cookie.pm') diff --git a/Bugzilla/Auth/Login/Cookie.pm b/Bugzilla/Auth/Login/Cookie.pm index 9c18903b6..e3ba98183 100644 --- a/Bugzilla/Auth/Login/Cookie.pm +++ b/Bugzilla/Auth/Login/Cookie.pm @@ -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 }); } } -- cgit v1.2.1