Closed
Bug 298507
Opened 19 years ago
Closed 19 years ago
several uninitialized values used in editwhines.cgi
Categories
(Bugzilla :: Whining, defect)
Tracking
()
RESOLVED
FIXED
Bugzilla 2.20
People
(Reporter: karl, Assigned: karl)
References
Details
Attachments
(1 file, 1 obsolete file)
610 bytes,
patch
|
LpSolit
:
review+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax)
When filling in the subject of a newly-created whining event, an error is
generated in the error_log, presumably because the original subject or body was
never defined.
Reproducible: Always
Steps to Reproduce:
1. Log into Bugzilla tip with an account that can modify its own whines.
2. Access editwhines.cgi
3. Create a new wining event
4. In the empty form that appears, fill in the subject AND NOTHING ELSE
Actual Results:
The following error was logged in the error.log:
editwhines.cgi: Use of uninitialized value in string ne at
/Library/WebServer/Documents/bugzilla-new/editwhines.cgi line 150.
Expected Results:
I expected to see zero errors generated when loading the page.
This is using the version of editwhines.cgi from tip.
Assignee | ||
Updated•19 years ago
|
Summary: whine subject used unitialized value in editwhines.cgi → whine subject used unitialized value in editwhines.cgi
Version: unspecified → 2.19.3
Assignee | ||
Updated•19 years ago
|
Blocks: bz-warnings
Updated•19 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee | ||
Comment 1•19 years ago
|
||
I was actually off by one. It wasn't $subject or $body that was failing, it
was $events->{$eventid}->{'subject'} and $events->{$eventid}->{'body'}.
It seems that when a new whining event is created (lines 88-95), NULL is used
as the default values for subject and body, which makes the subject/body in the
hash undefined.
I guess this is the most basic solution. Before the comparison around line
150, the hash is checked and any undef values are reaplaced with an empty
string.
Attachment #188080 -
Flags: review?(LpSolit)
Comment 2•19 years ago
|
||
Comment on attachment 188080 [details] [diff] [review]
Patch v1
>+ $events->{$eventid}->{'subject'} |= '';
>+ $events->{$eventid}->{'body'} |= '';
The right fix is to modify get_events(), assuming we don't want to store empty
strings into the 'whine_events' table:
$events->{$ev} = {
'subject' => $sub || '',
'body' => $bod || '',
};
Attachment #188080 -
Flags: review?(LpSolit) → review-
Updated•19 years ago
|
Assignee: erik → karl
Target Milestone: --- → Bugzilla 2.20
Comment 3•19 years ago
|
||
*** Bug 298509 has been marked as a duplicate of this bug. ***
Updated•19 years ago
|
Status: NEW → ASSIGNED
Summary: whine subject used unitialized value in editwhines.cgi → several uninitialized values used in editwhines.cgi
Assignee | ||
Comment 4•19 years ago
|
||
Attachment #188080 -
Attachment is obsolete: true
Attachment #188119 -
Flags: review?(LpSolit)
Comment 5•19 years ago
|
||
Comment on attachment 188119 [details] [diff] [review]
Patch v2
r=LpSolit
Attachment #188119 -
Flags: review?(LpSolit) → review+
Updated•19 years ago
|
Flags: approval?
Comment 6•19 years ago
|
||
Note that there is still a potential undefined value at line 194 due to:
if ($cgi->param("mailto_type_$sid") == MAILTO_USER)
I still don't understand how $cgi->param("mailto_type_$sid") could be undefined.
Updated•19 years ago
|
Flags: blocking2.20+
Flags: approval?
Flags: approval+
Comment 7•19 years ago
|
||
Checking in editwhines.cgi;
/cvsroot/mozilla/webtools/bugzilla/editwhines.cgi,v <-- editwhines.cgi
new revision: 1.7; previous revision: 1.6
done
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•