From 6d369bd4e485bf3559a81db2d15c17b0da9c80c8 Mon Sep 17 00:00:00 2001 From: "bzrmirror%bugzilla.org" Date: Thu, 31 Jul 2014 17:30:50 +0000 Subject: [PATCH] Bug 1044701: "Uninitialized value $token_type" when passing an invalid Bugzilla_api_token value r=sgreen,a=glob git-svn-id: svn://10.0.0.236/trunk@265484 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/.bzrrev | 2 +- mozilla/webtools/bugzilla/.gitrev | 2 +- mozilla/webtools/bugzilla/Bugzilla/Auth/Login/Cookie.pm | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/mozilla/webtools/bugzilla/.bzrrev b/mozilla/webtools/bugzilla/.bzrrev index aadd6a4f461..f15f2894bd5 100644 --- a/mozilla/webtools/bugzilla/.bzrrev +++ b/mozilla/webtools/bugzilla/.bzrrev @@ -1 +1 @@ -9094 \ No newline at end of file +9095 \ No newline at end of file diff --git a/mozilla/webtools/bugzilla/.gitrev b/mozilla/webtools/bugzilla/.gitrev index b029c8df0f2..7efa1de97f7 100644 --- a/mozilla/webtools/bugzilla/.gitrev +++ b/mozilla/webtools/bugzilla/.gitrev @@ -1 +1 @@ -8770b2cb9cbbb61c1eae54c9ce1f564f9d350044 \ No newline at end of file +88db66c588e8c411daffb13b53e4a1f5f259dc48 \ No newline at end of file diff --git a/mozilla/webtools/bugzilla/Bugzilla/Auth/Login/Cookie.pm b/mozilla/webtools/bugzilla/Bugzilla/Auth/Login/Cookie.pm index 9c18903b697..e3ba9818376 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Auth/Login/Cookie.pm +++ b/mozilla/webtools/bugzilla/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 }); } }