Closed
Bug 561848
Opened 15 years ago
Closed 15 years ago
nsNavHistoryContainerResultNode::GetChildIndex is assigning a signed int to an unsigned one
Categories
(Toolkit :: Places, defect)
Toolkit
Places
Tracking
()
RESOLVED
FIXED
mozilla1.9.3a5
People
(Reporter: mak, Assigned: mak)
References
Details
(Keywords: regression)
Attachments
(2 files)
640 bytes,
patch
|
dietrich
:
review+
|
Details | Diff | Splinter Review |
4.55 KB,
patch
|
dietrich
:
review+
|
Details | Diff | Splinter Review |
*_retval = FindChild(static_cast<nsNavHistoryResultNode*>(aNode));
if (*_retval == -1)
FindChild returns a signed int that can be -1, but *_retval is unsigned, this could explain some of the random failures i've seen.
Assignee | ||
Updated•15 years ago
|
Blocks: 520659
Keywords: regression
Assignee | ||
Comment 1•15 years ago
|
||
Attachment #441611 -
Flags: review?(dietrich)
Updated•15 years ago
|
Attachment #441611 -
Flags: review?(dietrich) → review+
Comment 2•15 years ago
|
||
is there a way for us to test a failure scenario here?
Assignee | ||
Comment 3•15 years ago
|
||
oh, it should be possible to invoke the method, pass it a not existing node and get back an index instead, so yeah i think i can make a test (actually i wanted to do it yesterday but i was surprised by the thunderstorm, and just attached the patch)
Flags: in-testsuite?
Assignee | ||
Comment 4•15 years ago
|
||
pushed the fix:
http://hg.mozilla.org/mozilla-central/rev/06b78c632960
i'm working on the test, will follow shortly.
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a5
Assignee | ||
Comment 5•15 years ago
|
||
So, unfortunatly i cannot test the wrong assignment because cpp does not have strict type safety, in this case it is clearly wrong, but on our tier platforms that is probably going to be unnoticed, Windows does not even warn about the signed assign to an unsigned int (Linux GCC does luckily). And actually the condition was still satisfied thanks to an implicit conversion. To test this i should add more than 2^32 nodes, that's not feasible.
Thus, this is just a functionality test for the API, but passes regardless status of this bug.
Attachment #441803 -
Flags: review?(dietrich)
Comment 6•15 years ago
|
||
Comment on attachment 441803 [details] [diff] [review]
functionality test
code coverage ftw, i guess.
Attachment #441803 -
Flags: review?(dietrich) → review+
Assignee | ||
Comment 7•15 years ago
|
||
Flags: in-testsuite? → in-testsuite+
You need to log in
before you can comment on or make changes to this bug.
Description
•