internal/pipewire: zero size before validation
All checks were successful
Test / Create distribution (push) Successful in 38s
Test / Sandbox (push) Successful in 2m19s
Test / Hakurei (push) Successful in 3m16s
Test / Hpkg (push) Successful in 4m8s
Test / Sandbox (race detector) (push) Successful in 4m24s
Test / Hakurei (race detector) (push) Successful in 5m9s
Test / Flake checks (push) Successful in 1m21s

Leftover values from previous invocations cause incorrect behaviour here.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
Ophestra 2025-11-25 12:21:37 +09:00
parent fc3d78fe01
commit b1b27ac1df
Signed by: cat
SSH Key Fingerprint: SHA256:wr6yH7sDDbUFi81k/GsIGwpM3O2QrwqYlLF26CcJa4w

View File

@ -260,6 +260,7 @@ func unmarshalValue(data []byte, v reflect.Value, sizeP *Word) error {
return nil return nil
case reflect.Struct: case reflect.Struct:
*sizeP = 0
if err := unmarshalCheckTypeBounds(&data, SPA_TYPE_Struct, sizeP); err != nil { if err := unmarshalCheckTypeBounds(&data, SPA_TYPE_Struct, sizeP); err != nil {
return err return err
} }
@ -294,6 +295,7 @@ func unmarshalValue(data []byte, v reflect.Value, sizeP *Word) error {
} }
case reflect.String: case reflect.String:
*sizeP = 0
if err := unmarshalCheckTypeBounds(&data, SPA_TYPE_String, sizeP); err != nil { if err := unmarshalCheckTypeBounds(&data, SPA_TYPE_String, sizeP); err != nil {
return err return err
} }