Closed Bug 310569 Opened 19 years ago Closed 19 years ago

64-bit unsafe cast in nsMsgIncomingServer.cpp

Categories

(Thunderbird :: Build Config, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird1.1

People

(Reporter: benjamin, Assigned: benjamin)

References

Details

(Keywords: fixed1.8)

Attachments

(1 file)

nsMsgIncomingService casts directly from void* to int32, which break on x86_84.
Attachment #197990 - Flags: review?(mscott)
This means we don't build on linux x86_64
Flags: blocking1.8b5?
Comment on attachment 197990 [details] [diff] [review]
use NS_PTR_TO_INT32

much better
Attachment #197990 - Flags: review?(mscott) → review+
Flags: blocking1.8b5?
Attachment #197990 - Flags: approval1.8b5+
*** Bug 310495 has been marked as a duplicate of this bug. ***
Fixed, trunk and branch
Status: NEW → RESOLVED
Closed: 19 years ago
Keywords: fixed1.8
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird1.1
+  PRInt32 hashValue = NS_PTR_TO_INT32(m_downloadedHdrs.Get(&hashKey));
   if (hashValue)

mscott, why cast it to int in the first place?
Benjamin, please address my comment. I think you are introducing a bug in this
patch.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Ilya, the extra cast is probably not necessary, but it's not a bug.
Status: REOPENED → RESOLVED
Closed: 19 years ago19 years ago
Resolution: --- → FIXED
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.
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.

Attachment

General

Created:
Updated:
Size: