vendor github.com/godbus/dbus/v5@4b691ce

This pulls in https://github.com/godbus/dbus/pull/332 allowing dbus to
build without cgo on FreeBSD. This will allow freebsd targets in the cross
build.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
This commit is contained in:
Doug Rabson
2022-10-29 16:03:29 +01:00
parent a263069568
commit 0d505f20ff
26 changed files with 111 additions and 108 deletions

View File

@@ -158,7 +158,9 @@ func DecodeMessageWithFDs(rd io.Reader, fds []int) (msg *Message, err error) {
if err != nil {
return nil, err
}
binary.Read(bytes.NewBuffer(b), order, &hlength)
if err := binary.Read(bytes.NewBuffer(b), order, &hlength); err != nil {
return nil, err
}
if hlength+length+16 > 1<<27 {
return nil, InvalidMessageError("message is too long")
}
@@ -265,12 +267,14 @@ func (msg *Message) EncodeToWithFDs(out io.Writer, order binary.ByteOrder) (fds
return
}
enc.align(8)
body.WriteTo(&buf)
if _, err := body.WriteTo(&buf); err != nil {
return nil, err
}
if buf.Len() > 1<<27 {
return make([]int, 0), InvalidMessageError("message is too long")
return nil, InvalidMessageError("message is too long")
}
if _, err := buf.WriteTo(out); err != nil {
return make([]int, 0), err
return nil, err
}
return enc.fds, nil
}