internal/pipewire: bounds check against wire size
All checks were successful
Test / Create distribution (push) Successful in 40s
Test / Sandbox (push) Successful in 2m23s
Test / Hakurei (push) Successful in 3m22s
Test / Hpkg (push) Successful in 4m13s
Test / Sandbox (race detector) (push) Successful in 4m25s
Test / Hakurei (race detector) (push) Successful in 5m14s
Test / Flake checks (push) Successful in 1m25s

This covers cases where wire size is not known ahead of time.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
Ophestra 2025-11-25 13:42:31 +09:00
parent a0eb010aab
commit 2d7b896a8c
Signed by: cat
SSH Key Fingerprint: SHA256:wr6yH7sDDbUFi81k/GsIGwpM3O2QrwqYlLF26CcJa4w

View File

@ -349,7 +349,7 @@ func unmarshalCheckTypeBounds(data *[]byte, t Word, sizeP *Word) error {
if wantSize != 0 && gotSize != wantSize {
return &InconsistentSizeError{gotSize, wantSize}
}
if len(*data)-8 < int(wantSize) {
if len(*data)-8 < int(gotSize) {
return io.ErrUnexpectedEOF
}