Closed
Bug 276913
Opened 20 years ago
Closed 20 years ago
Uninitialized value message from CGI.pl line 176
Categories
(Bugzilla :: Bugzilla-General, defect)
Tracking
()
RESOLVED
FIXED
Bugzilla 2.18
People
(Reporter: mkanat, Assigned: LpSolit)
References
Details
Attachments
(2 files, 1 obsolete file)
|
694 bytes,
patch
|
mkanat
:
review+
|
Details | Diff | Splinter Review |
|
695 bytes,
patch
|
mkanat
:
review+
|
Details | Diff | Splinter Review |
I see a lot of this in landfill's error_log for Apache: [Sun Jan 02 18:59:34 2005] [error] [client 202.22.158.65] [Sun Jan 2 18:59:34 2005] show_bug.cgi: Use of uninitialized value in string eq at CGI.pl line 176., referer: http://landfill.bugzilla.org/bugzilla-tip/buglist.cgi?query_format=specific&order=relevance+desc&bug_status=__open__&product=&content= The line is: return if ($field eq "dependson" || $field eq "blocked"); It just needs to check for the actual *existence* of $field.
| Reporter | ||
Comment 1•20 years ago
|
||
This was introduced by bug 264601, according to cvs blame.
| Reporter | ||
Comment 2•20 years ago
|
||
The actually correct way to fix this bug is to set a default for $field when it isn't passed. I'm assuming that developers are assuming bug_id when they don't pass a field name. I could also put "unknown."
| Assignee | ||
Comment 3•20 years ago
|
||
I have a patch for this too. I wrote it just before 31. December. That's the reason why this patch and some others have not been uploaded yet. I will submit in a few minutes. Taking bug!
Assignee: mkanat → LpSolit
| Reporter | ||
Comment 4•20 years ago
|
||
OK, here's a very simple patch to solve this problem. Anybody may do the review if they want, but lpsolit wrote the original code, so I wanted him to look at it. By the way, this code is *really* confusing. I had to actually go look at the user-error template to understand what $field was being used for.
Attachment #170178 -
Flags: review?(LpSolit)
| Reporter | ||
Comment 5•20 years ago
|
||
Oh, OK. You can upload your patch, also. :-)
Flags: blocking2.20?
Flags: approval2.18?
| Reporter | ||
Comment 6•20 years ago
|
||
I tried to clear approval2.18? but it won't let me, even though I'm the one who set it.
Flags: blocking2.18?
Updated•20 years ago
|
Flags: approval2.18?
| Assignee | ||
Comment 7•20 years ago
|
||
Attachment #170180 -
Flags: review?(mkanat)
| Reporter | ||
Comment 8•20 years ago
|
||
Comment on attachment 170180 [details] [diff] [review] Check if $field is defined >- return if ($field eq "dependson" || $field eq "blocked"); >+ return if (defined $field && ($field eq "dependson" || $field eq "blocked")); If you could change that to defined($field) on checkin I'd be happy. Otherwise this is fine.
Attachment #170180 -
Flags: review?(mkanat) → review+
| Reporter | ||
Updated•20 years ago
|
Attachment #170178 -
Flags: review?(LpSolit)
| Reporter | ||
Comment 9•20 years ago
|
||
OK, *now* I'm asking for approval.
Flags: approval?
Flags: approval2.18?
| Assignee | ||
Comment 10•20 years ago
|
||
(In reply to comment #8) > If you could change that to defined($field) on checkin I'd be happy. Not sure this is really necessary. Too many () aren't good. ;)
Status: NEW → ASSIGNED
| Reporter | ||
Comment 11•20 years ago
|
||
(In reply to comment #10) > Not sure this is really necessary. Too many () aren't good. ;) I fully disagree. Read the perlstyle manual. (And every other programming-style manual in existence.)
Updated•20 years ago
|
Whiteboard: patch awaiting approval
Comment 12•20 years ago
|
||
Not that Max nee(In reply to comment #11) > (In reply to comment #10) > > Too many () aren't good. ;) > I fully disagree. Not that Max needs my help, but he's right. Explicitly stating your wishes (in this case, by wrapping your code in () ) is far better than hoping that the compiler -- and every future compiler -- does things the way you want it to be done. Also remember, you won't be maintaining this code forever, or even necessarily next month. We owe it to the future guys who have to read/decipher it to make things as clear as possible.
Updated•20 years ago
|
Flags: blocking2.20?
Flags: blocking2.20+
Flags: blocking2.18?
Flags: blocking2.18+
Flags: approval?
Flags: approval2.18?
Flags: approval2.18+
Flags: approval+
Target Milestone: --- → Bugzilla 2.18
Updated•20 years ago
|
Whiteboard: patch awaiting approval → patch awaiting checkin
| Assignee | ||
Updated•20 years ago
|
Attachment #170178 -
Attachment is obsolete: true
| Assignee | ||
Comment 13•20 years ago
|
||
The line following my patch differs between 2.18 and 2.19.1 so I need to write the same patch for the 2.18 branch. For consistency with my already approved patch, I don't add () around $field.
Attachment #170479 -
Flags: review?(mkanat)
| Reporter | ||
Comment 14•20 years ago
|
||
Comment on attachment 170479 [details] [diff] [review] backport for the 2.18 branch Yes, I cetify that this patch is the same as the one above. :-)
Attachment #170479 -
Flags: review?(mkanat) → review+
Comment 15•20 years ago
|
||
2.18: Checking in CGI.pl; /cvsroot/mozilla/webtools/bugzilla/CGI.pl,v <-- CGI.pl new revision: 1.211.2.5; previous revision: 1.211.2.4 done Tip: Checking in CGI.pl; /cvsroot/mozilla/webtools/bugzilla/CGI.pl,v <-- CGI.pl new revision: 1.219; previous revision: 1.218 done
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Whiteboard: patch awaiting checkin
| Assignee | ||
Comment 16•20 years ago
|
||
*** Bug 281013 has been marked as a duplicate of this bug. ***
Updated•20 years ago
|
Whiteboard: [applied to b.m.o]
Updated•19 years ago
|
Whiteboard: [applied to b.m.o]
Updated•12 years ago
|
QA Contact: matty_is_a_geek → default-qa
You need to log in
before you can comment on or make changes to this bug.
Description
•