diff options
author | Frédéric Buclin <LpSolit@gmail.com> | 2012-05-21 20:07:33 +0200 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2012-05-21 20:07:33 +0200 |
commit | fc9858fed697d00fb921dd86448dad0ef70552a6 (patch) | |
tree | 0ea0fcc2484767562729c45278dc96241f59d67c /Bugzilla | |
parent | 5ec002f8c6aaf5dba9039ac8ae5898b07af4afee (diff) | |
download | bugzilla-fc9858fed697d00fb921dd86448dad0ef70552a6.tar.gz bugzilla-fc9858fed697d00fb921dd86448dad0ef70552a6.tar.xz |
Bug 754090: Bugzilla::FlagType::match() crashes when the group parameter is not a number
a=LpSolit
Diffstat (limited to 'Bugzilla')
-rw-r--r-- | Bugzilla/FlagType.pm | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Bugzilla/FlagType.pm b/Bugzilla/FlagType.pm index b30065a1c..15d982744 100644 --- a/Bugzilla/FlagType.pm +++ b/Bugzilla/FlagType.pm @@ -681,7 +681,10 @@ sub sqlify_criteria { } if ($criteria->{product_id}) { my $product_id = $criteria->{product_id}; - + detaint_natural($product_id) + || ThrowCodeError('bad_arg', { argument => 'product_id', + function => 'Bugzilla::FlagType::sqlify_criteria' }); + # Add inclusions to the query, which simply involves joining the table # by flag type ID and target product/component. push(@$tables, "INNER JOIN flaginclusions AS i ON flagtypes.id = i.type_id"); @@ -698,6 +701,10 @@ sub sqlify_criteria { my $addl_join_clause = ""; if ($criteria->{component_id}) { my $component_id = $criteria->{component_id}; + detaint_natural($component_id) + || ThrowCodeError('bad_arg', { argument => 'component_id', + function => 'Bugzilla::FlagType::sqlify_criteria' }); + push(@criteria, "(i.component_id = $component_id OR i.component_id IS NULL)"); $join_clause .= "AND (e.component_id = $component_id OR e.component_id IS NULL) "; } @@ -711,7 +718,10 @@ sub sqlify_criteria { } if ($criteria->{group}) { my $gid = $criteria->{group}; - detaint_natural($gid); + detaint_natural($gid) + || ThrowCodeError('bad_arg', { argument => 'group', + function => 'Bugzilla::FlagType::sqlify_criteria' }); + push(@criteria, "(flagtypes.grant_group_id = $gid " . " OR flagtypes.request_group_id = $gid)"); } |