Skip to content

Commit

Permalink
protocol: Increase oob buffer size, slice on use
Browse files Browse the repository at this point in the history
  • Loading branch information
kennylevinsen committed Jun 3, 2020
1 parent 1caef08 commit c848ee0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type WaylandGlobal struct {
func ReadPacket(conn *net.UnixConn) (*WaylandPacket, error) {
var fds []uintptr
var buf [8]byte
control := make([]byte, 24)
control := make([]byte, 128)

n, oobn, _, _, err := conn.ReadMsgUnix(buf[:], control)
if err != nil {
Expand All @@ -42,7 +42,7 @@ func ReadPacket(conn *net.UnixConn) (*WaylandPacket, error) {
return nil, errors.New("Control message buffer undersized")
}

ctrl, err := unix.ParseSocketControlMessage(control)
ctrl, err := unix.ParseSocketControlMessage(control[:oobn])
if err != nil {
return nil, err
}
Expand Down

0 comments on commit c848ee0

Please sign in to comment.