Closed
Bug 104065
Opened 23 years ago
Closed 23 years ago
uninitialized string in "process_bug.cgi" line 92
Categories
(Bugzilla :: Creating/Changing Bugs, defect)
Tracking
()
RESOLVED
FIXED
Bugzilla 2.16
People
(Reporter: kwilliams, Assigned: justdave)
References
Details
Attachments
(1 file)
775 bytes,
patch
|
jacob
:
review+
jacob
:
review+
|
Details | Diff | Splinter Review |
(W uninitialized) An undefined value was used as if it were already defined. It was interpreted as a "" or a 0, but maybe it was a mistake. To suppress this warning assign a defined value to your variables. [Wed Oct 10 11:24:39 2001] C:\bugzilla-2.14\process_bug.cgi: Use of uninitialized value in string ne at C:\bugzilla-2.14\process_bug.cgi line 92. Content-type: text/html
Assignee | ||
Comment 1•23 years ago
|
||
Kevin: the code has changed too much since 2.14 came out and I don't have a copy of it handy... would you happen to be able to look up what's on line 92 and paste in a few of the surrounding lines here just for context? thanks.
Reporter | ||
Comment 2•23 years ago
|
||
Here's the code section: ---------------- snip --------------------------- # If the user has a bug list and is processing one bug, then after # we process the bug we are going to show them the next bug on their # list. Thus we have to make sure this bug ID is also valid, # since a malicious cracker might alter their cookies for the purpose # gaining access to bugs they are not authorized to access. if ( $::COOKIE{"BUGLIST"} ne "" && defined $::FORM{'id'} ) { my @buglist = split( /:/ , $::COOKIE{"BUGLIST"} ); my $idx = lsearch( \@buglist , $::FORM{"id"} ); if ($idx < $#buglist) { my $nextbugid = $buglist[$idx + 1]; ValidateBugID($nextbugid); } } ------------------------- end snip ---------------------------------
Assignee | ||
Comment 3•23 years ago
|
||
ok, now for the stupid question, which line in that snippet was line 92? :) Just looking at it though, I'm betting on $::COOKIE{"BUGLIST"} being the problem, because if the person has cookies turned off, or hasn't viewed any buglists yet, this cookie wouldn't exist. We'd be better off changing that to make sure the cookie exists instead of making sure it's not empty.
Reporter | ||
Comment 4•23 years ago
|
||
Yes, that's the correct line. Your idea makes sense to me. It seems that we could wrap that code in a conditional to test for the cookie first. I've never coded cookies in Perl, so I can't help with the code. If you could post that code fix, I would greatly appreciate it.
Assignee | ||
Comment 5•23 years ago
|
||
heh, was working on that already. patch coming right up.
Assignee | ||
Comment 6•23 years ago
|
||
Comment 7•23 years ago
|
||
Makes sense. r=gerv. Gerv
Comment 8•23 years ago
|
||
Comment on attachment 53579 [details] [diff] [review] check for defined instead of ne "" I can't think of any time when it would be "" instead of undef, so r=jake (r1 was Gerv).
Attachment #53579 -
Flags: review+
Comment 9•23 years ago
|
||
Checking in process_bug.cgi; /cvsroot/mozilla/webtools/bugzilla/process_bug.cgi,v <-- process_bug.cgi new revision: 1.102; previous revision: 1.101 done
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 10•22 years ago
|
||
*** Bug 137893 has been marked as a duplicate of this bug. ***
Updated•11 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
•