зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1084342: Copy received ancillary data into |SocketMessageWatcher|, r=shawnjohnjr
The cast-and-assign pattern for retrieving file descriptors is prone to SIGBUS signals on platforms that don't support unaligned memory access. This patch fixes the problem by copying the received data directly.
This commit is contained in:
Родитель
5c750e1803
Коммит
9133e20f81
|
@ -232,7 +232,7 @@ SocketMessageWatcher::RecvMsg2()
|
|||
TEMP_FAILURE_RETRY(close(mClientFd));
|
||||
}
|
||||
// retrieve sent client fd
|
||||
mClientFd = *(static_cast<int*>(CMSG_DATA(cmsgptr)));
|
||||
memcpy(&mClientFd, CMSG_DATA(cmsgptr), sizeof(mClientFd));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -232,7 +232,7 @@ SocketMessageWatcher::RecvMsg2()
|
|||
TEMP_FAILURE_RETRY(close(mClientFd));
|
||||
}
|
||||
// retrieve sent client fd
|
||||
mClientFd = *(static_cast<int*>(CMSG_DATA(cmsgptr)));
|
||||
memcpy(&mClientFd, CMSG_DATA(cmsgptr), sizeof(mClientFd));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче