Commit f8b8880a authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 377913: Crash when setting a requestee for a deleted flag (race condition) -…

Bug 377913: Crash when setting a requestee for a deleted flag (race condition) - Patch by Fré©ric Buclin <LpSolit@gmail.com> r=wicked a=LpSolit
parent 8ce61a1c
...@@ -1169,16 +1169,26 @@ sub match_field { ...@@ -1169,16 +1169,26 @@ sub match_field {
# The field is a requestee field; in order for its name # The field is a requestee field; in order for its name
# to show up correctly on the confirmation page, we need # to show up correctly on the confirmation page, we need
# to find out the name of its flag type. # to find out the name of its flag type.
if ($field_name =~ /^requestee-(\d+)$/) { if ($field_name =~ /^requestee(_type)?-(\d+)$/) {
require Bugzilla::Flag; my $flag_type;
my $flag = new Bugzilla::Flag($1); if ($1) {
$expanded_fields->{$field_name}->{'flag_type'} = require Bugzilla::FlagType;
$flag->type; $flag_type = new Bugzilla::FlagType($2);
} }
elsif ($field_name =~ /^requestee_type-(\d+)$/) { else {
require Bugzilla::FlagType; require Bugzilla::Flag;
$expanded_fields->{$field_name}->{'flag_type'} = my $flag = new Bugzilla::Flag($2);
new Bugzilla::FlagType($1); $flag_type = $flag->type if $flag;
}
if ($flag_type) {
$expanded_fields->{$field_name}->{'flag_type'} = $flag_type;
}
else {
# No need to look for a valid requestee if the flag(type)
# has been deleted (may occur in race conditions).
delete $expanded_fields->{$field_name};
$cgi->delete($field_name);
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment