зеркало из https://github.com/mozilla/gecko-dev.git
Bugzilla bug #33652: align PRNetAddr on 8-byte boundaries.
Modified files: prsocket.c, ptio.c
This commit is contained in:
Родитель
d58cbd4e51
Коммит
574eaf987b
|
@ -1645,8 +1645,9 @@ PRInt32 _PR_EmulateAcceptRead(
|
|||
if (rv >= 0)
|
||||
{
|
||||
/* copy the new info out where caller can see it */
|
||||
PRPtrdiff aligned = (PRPtrdiff)buf + amount + sizeof(void*) - 1;
|
||||
*raddr = (PRNetAddr*)(aligned & ~(sizeof(void*) - 1));
|
||||
enum { AMASK = 7 }; /* mask for alignment of PRNetAddr */
|
||||
PRPtrdiff aligned = (PRPtrdiff)buf + amount + AMASK;
|
||||
*raddr = (PRNetAddr*)(aligned & ~AMASK);
|
||||
memcpy(*raddr, &remote, PR_NETADDR_SIZE(&remote));
|
||||
*nd = accepted;
|
||||
return rv;
|
||||
|
|
|
@ -2103,8 +2103,9 @@ static PRInt32 pt_AcceptRead(
|
|||
if (rv >= 0)
|
||||
{
|
||||
/* copy the new info out where caller can see it */
|
||||
PRPtrdiff aligned = (PRPtrdiff)buf + amount + sizeof(void*) - 1;
|
||||
*raddr = (PRNetAddr*)(aligned & ~(sizeof(void*) - 1));
|
||||
enum { AMASK = 7 }; /* mask for alignment of PRNetAddr */
|
||||
PRPtrdiff aligned = (PRPtrdiff)buf + amount + AMASK;
|
||||
*raddr = (PRNetAddr*)(aligned & ~AMASK);
|
||||
memcpy(*raddr, &remote, PR_NETADDR_SIZE(&remote));
|
||||
*nd = accepted;
|
||||
return rv;
|
||||
|
|
Загрузка…
Ссылка в новой задаче