From: David Lawrence Date: Thu, 31 Jul 2014 17:09:53 +0000 (+0000) Subject: Bug 1044701: "Uninitialized value $token_type" when passing an invalid Bugzilla_api_t... X-Git-Tag: bugzilla-4.5.6~69 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=88db66c588e8c411daffb13b53e4a1f5f259dc48;p=thirdparty%2Fbugzilla.git Bug 1044701: "Uninitialized value $token_type" when passing an invalid Bugzilla_api_token value r=sgreen,a=glob --- diff --git a/Bugzilla/Auth/Login/Cookie.pm b/Bugzilla/Auth/Login/Cookie.pm index 9c18903b69..e3ba981837 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 }); } }