From: lpsolit%gmail.com <> Date: Tue, 3 Nov 2009 19:46:13 +0000 (+0000) Subject: Bug 526271: Uninitialized value in can_enter_product() due to a missing argument... X-Git-Tag: bugzilla-3.5.1~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed629ca0a2680ebeed503ca7d071fbf8ab8dfbec;p=thirdparty%2Fbugzilla.git Bug 526271: Uninitialized value in can_enter_product() due to a missing argument - Patch by Frédéric Buclin r=ghendricks a=LpSolit --- diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm index 9cb53fe346..3843062fbf 100644 --- a/Bugzilla/User.pm +++ b/Bugzilla/User.pm @@ -714,6 +714,7 @@ sub get_selectable_classifications { sub can_enter_product { my ($self, $input, $warn) = @_; my $dbh = Bugzilla->dbh; + $warn ||= 0; if (!defined $input) { return unless $warn == THROW_ERROR; diff --git a/buglist.cgi b/buglist.cgi index 60713b0358..a8103a1e0f 100755 --- a/buglist.cgi +++ b/buglist.cgi @@ -1101,7 +1101,7 @@ elsif (my @product_input = $cgi->param('product')) { } # We only want the template to use it if the user can actually # enter bugs against it. -if (Bugzilla->user->can_enter_product($one_product)) { +if ($one_product && Bugzilla->user->can_enter_product($one_product)) { $vars->{'one_product'} = $one_product; }