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