Explicitly unpoison the result of FD_ZERO
parent
c82fd655ed
commit
ac386cf0d7
12
socketft.cpp
12
socketft.cpp
|
|
@ -19,6 +19,10 @@
|
|||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
|
||||
#if defined(CRYPTOPP_MSAN)
|
||||
# include <sanitizer/msan_interface.h>
|
||||
#endif
|
||||
|
||||
#ifdef PREFER_WINDOWS_STYLE_SOCKETS
|
||||
# pragma comment(lib, "ws2_32.lib")
|
||||
#endif
|
||||
|
|
@ -239,6 +243,10 @@ bool Socket::SendReady(const timeval *timeout)
|
|||
fd_set fds;
|
||||
FD_ZERO(&fds);
|
||||
FD_SET(m_s, &fds);
|
||||
#ifdef CRYPTOPP_MSAN
|
||||
__msan_unpoison(&fds, sizeof(fds));
|
||||
#endif
|
||||
|
||||
int ready;
|
||||
if (timeout == NULL)
|
||||
ready = select((int)m_s+1, NULL, &fds, NULL, NULL);
|
||||
|
|
@ -256,6 +264,10 @@ bool Socket::ReceiveReady(const timeval *timeout)
|
|||
fd_set fds;
|
||||
FD_ZERO(&fds);
|
||||
FD_SET(m_s, &fds);
|
||||
#ifdef CRYPTOPP_MSAN
|
||||
__msan_unpoison(&fds, sizeof(fds));
|
||||
#endif
|
||||
|
||||
int ready;
|
||||
if (timeout == NULL)
|
||||
ready = select((int)m_s+1, &fds, NULL, NULL, NULL);
|
||||
|
|
|
|||
8
wait.cpp
8
wait.cpp
|
|
@ -20,6 +20,10 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if defined(CRYPTOPP_MSAN)
|
||||
# include <sanitizer/msan_interface.h>
|
||||
#endif
|
||||
|
||||
NAMESPACE_BEGIN(CryptoPP)
|
||||
|
||||
unsigned int WaitObjectContainer::MaxWaitObjects()
|
||||
|
|
@ -47,6 +51,10 @@ void WaitObjectContainer::Clear()
|
|||
m_maxFd = 0;
|
||||
FD_ZERO(&m_readfds);
|
||||
FD_ZERO(&m_writefds);
|
||||
# ifdef CRYPTOPP_MSAN
|
||||
__msan_unpoison(&m_readfds, sizeof(m_readfds));
|
||||
__msan_unpoison(&m_writefds, sizeof(m_writefds));
|
||||
# endif
|
||||
#endif
|
||||
m_noWait = false;
|
||||
m_firstEventTime = 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue