Closed Bug 33652 Opened 24 years ago Closed 24 years ago

PR_AcceptRead should not align PRNetAddr on the size of void*

Categories

(NSPR :: NSPR, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: wtc, Assigned: wtc)

Details

Attachments

(1 file)

This bug is reported by nelsonb@netscape.com.  (See
bug #31674.)

The current emulated implementation of PR_AcceptRead
aligns PRNetAddr on the size of void*.  (See
_PR_EmulateAcceptRead in prsocket.c and pt_AcceptRead
in ptio.c.)  The idea is that the alignment of void*
is the most stringent. However, this assumption is
incorrect.  For example, on 32-bit IRIX (N32 ABI), the
size of void* is 4, but the 64-bit long long type must
be aligned on 8 byte boundaries.

Starting in NSPR 4.0, PRNetAddr contains PRUint64, so
it must be aligned according to PRUint64.  To simplify
things we can just align PRNetAddr on 8-byte boundaries,
which may be more than necessary but is always correct.
Checked in the fix.
/cvsroot/mozilla/nsprpub/pr/src/io/prsocket.c, revision 3.29
/cvsroot/mozilla/nsprpub/pr/src/pthreads/ptio.c, revision 3.48
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Target Milestone: --- → 4.1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: