Closed
Bug 310569
Opened 19 years ago
Closed 19 years ago
64-bit unsafe cast in nsMsgIncomingServer.cpp
Categories
(Thunderbird :: Build Config, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
Thunderbird1.1
People
(Reporter: benjamin, Assigned: benjamin)
References
Details
(Keywords: fixed1.8)
Attachments
(1 file)
2.57 KB,
patch
|
mscott
:
review+
mscott
:
approval1.8b5+
|
Details | Diff | Splinter Review |
nsMsgIncomingService casts directly from void* to int32, which break on x86_84.
Assignee | ||
Comment 1•19 years ago
|
||
Attachment #197990 -
Flags: review?(mscott)
Comment 3•19 years ago
|
||
Comment on attachment 197990 [details] [diff] [review] use NS_PTR_TO_INT32 much better
Attachment #197990 -
Flags: review?(mscott) → review+
Updated•19 years ago
|
Flags: blocking1.8b5?
Updated•19 years ago
|
Attachment #197990 -
Flags: approval1.8b5+
Comment 4•19 years ago
|
||
*** Bug 310495 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 5•19 years ago
|
||
Fixed, trunk and branch
Status: NEW → RESOLVED
Closed: 19 years ago
Keywords: fixed1.8
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird1.1
Comment 6•19 years ago
|
||
+ PRInt32 hashValue = NS_PTR_TO_INT32(m_downloadedHdrs.Get(&hashKey)); if (hashValue) mscott, why cast it to int in the first place?
Comment 7•19 years ago
|
||
Benjamin, please address my comment. I think you are introducing a bug in this patch.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 8•19 years ago
|
||
Ilya, the extra cast is probably not necessary, but it's not a bug.
Status: REOPENED → RESOLVED
Closed: 19 years ago → 19 years ago
Resolution: --- → FIXED
Comment 9•19 years ago
|
||
Why is it a bug, you ask? The comparison would fail for every non-0 64bit pointer value which evaluates to '0' when cast to 32bit integer. This would be wrong, as this code intends to check whether the value exists in the hashtable. I understand the chances of this are slim, but still, it's simply not legal to lose data here.
Assignee | ||
Comment 10•19 years ago
|
||
It's not a pointer, it's a PRInt32 cast to a pointer. There can be no dataloss.
You need to log in
before you can comment on or make changes to this bug.
Description
•