Problem:
If FuzzedSock::Recv(N, MSG_PEEK)
is called then N
bytes would be
retrieved from the fuzz provider, saved in m_peek_data
and returned
to the caller (ok).
If after this FuzzedSock::Recv(M, 0)
is called where M < N
then the first M
bytes from m_peek_data
would be returned
to the caller (ok), but the remaining N - M
bytes in m_peek_data
would be discarded/lost (not ok). They must be returned by a subsequent
Recv()
.
To resolve this, only remove the head N
bytes from m_peek_data
.
This is a followup to #30211, more specifically: