Closed Bug 113646 Opened 23 years ago Closed 23 years ago

midair when changing assignee gives error

Categories

(Bugzilla :: Creating/Changing Bugs, defect)

2.15
x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 2.16

People

(Reporter: bbaetz, Assigned: myk)

Details

Attachments

(1 file)

I midaired while changing the assignee on a couple of the smoketest blockers
this morning, and went to continue (they were just comment changes)

I got:

unknown action 'hyatt@netscape.com'
Is the error message you reported capitalized correctly?  I was unable to find
an instance of the phrase "unknown action" in the Bugzilla code.
No, probably not. the machine I was on kept crashing, and teh keyboard had
broken vowel keys...

Trying locally, we get:

<input type=hidden name="knob" value="bbaetz+foo@localhost">

in the midair page, and so I get "Unknown action bbaetz+foo@localhost!" after
trying to continue anyway
Found the problem.
Status: NEW → ASSIGNED
The problem with the code is that the trim() function in globals.pl uses the
global variable $_ to store the value being trimmed.  Normally this won't cause
problems, but in this situation the Perl interpreter is already using $_ as the
value of $::FORM{'knob'} in the switch that starts on line 672 of
process_bug.cgi.

I'm not sure exactly why this causes problems, but I suspect that Perl copies
the value of $::FORM{'knob'} into $_ by reference rather than by value, so the
value of $::FORM{'knob'} gets changed to the trimmed value of
$::FORM{'assigned_to'} when the latter variable gets trimmed on line 708.

Using $_ as a temporary variable in trim() seems like a dangerous thing to do
in general, so the patch changes trim() to use a local variable instead.
Comment on attachment 60596 [details] [diff] [review]
patch v1: rewrites trim not to use $_ global variable

r=bbaetz
Attachment #60596 - Flags: review+
forgot to mention: I only gave this a very very quick test - 2nd reviewer needs
to do a real test.
Comment on attachment 60596 [details] [diff] [review]
patch v1: rewrites trim not to use $_ global variable

r= justdave
it works.
Attachment #60596 - Flags: review+
Target Milestone: --- → Bugzilla 2.16
Fix checked in
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: