diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-01-22 20:40:39 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-01-22 20:40:39 +0000 |
commit | 993bee6697b0e371d902f18b81787c14d12180f5 (patch) | |
tree | 0a35ed69a975448d874b765fbae6e229dd19621b /pkg/tcpip/transport/raw | |
parent | 77dfca5954fab10c93faff1236d9e42d84defc22 (diff) | |
parent | 6c0e1d9cfe6adbfbb32e7020d6426608ac63ad37 (diff) |
Merge release-20210112.0-74-g6c0e1d9cf (automated)
Diffstat (limited to 'pkg/tcpip/transport/raw')
-rw-r--r-- | pkg/tcpip/transport/raw/endpoint.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/tcpip/transport/raw/endpoint.go b/pkg/tcpip/transport/raw/endpoint.go index ae743f75e..2dacf5a64 100644 --- a/pkg/tcpip/transport/raw/endpoint.go +++ b/pkg/tcpip/transport/raw/endpoint.go @@ -280,9 +280,9 @@ func (e *endpoint) write(p tcpip.Payloader, opts tcpip.WriteOptions) (int64, *tc return 0, tcpip.ErrInvalidEndpointState } - payloadBytes, err := p.FullPayload() - if err != nil { - return 0, err + payloadBytes := make([]byte, p.Len()) + if _, err := io.ReadFull(p, payloadBytes); err != nil { + return 0, tcpip.ErrBadBuffer } // If this is an unassociated socket and callee provided a nonzero |