File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -577,15 +577,15 @@ class FuzzedSock : public Sock
577
577
public:
578
578
explicit FuzzedSock (FuzzedDataProvider& fuzzed_data_provider) : m_fuzzed_data_provider{fuzzed_data_provider}
579
579
{
580
- m_socket = fuzzed_data_provider.ConsumeIntegral <SOCKET>();
580
+ m_socket = fuzzed_data_provider.ConsumeIntegralInRange <SOCKET>(INVALID_SOCKET - 1 , INVALID_SOCKET );
581
581
}
582
582
583
583
~FuzzedSock () override
584
584
{
585
585
// Sock::~Sock() will be called after FuzzedSock::~FuzzedSock() and it will call
586
586
// Sock::Reset() (not FuzzedSock::Reset()!) which will call CloseSocket(m_socket).
587
- // Avoid closing an arbitrary file descriptor (m_socket is just a random number which
588
- // may concide with a real opened file descriptor).
587
+ // Avoid closing an arbitrary file descriptor (m_socket is just a random very high number which
588
+ // theoretically may concide with a real opened file descriptor).
589
589
Reset ();
590
590
}
591
591
Original file line number Diff line number Diff line change @@ -78,8 +78,7 @@ class StaticContentsSock : public Sock
78
78
explicit StaticContentsSock (const std::string& contents) : m_contents{contents}, m_consumed{0 }
79
79
{
80
80
// Just a dummy number that is not INVALID_SOCKET.
81
- static_assert (INVALID_SOCKET != 1000 );
82
- m_socket = 1000 ;
81
+ m_socket = INVALID_SOCKET - 1 ;
83
82
}
84
83
85
84
~StaticContentsSock () override { Reset (); }
You can’t perform that action at this time.
0 commit comments