diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-11-25 13:39:02 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-11-25 13:39:02 +0900 |
| commit | a0eb010aaba24e4cf20aedc04a2dc5fea5ec140c (patch) | |
| tree | 28098e21576eeca008574222a72572ee5cb96010 /internal | |
| parent | b1b27ac1df43d39b856983b4e930204b1a0f2e71 (diff) | |
internal/pipewire: spa_dict trailing garbage within POD
This performs the check within the bounds of the POD only. This was not caught since spa_dict was only used as the final struct field until now.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/pipewire/pod.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/internal/pipewire/pod.go b/internal/pipewire/pod.go index 9fb9c784..0faada2d 100644 --- a/internal/pipewire/pod.go +++ b/internal/pipewire/pod.go @@ -400,6 +400,8 @@ func (d *SPADict) UnmarshalPOD(data []byte) (Word, error) { if err := unmarshalCheckTypeBounds(&data, SPA_TYPE_Struct, &wireSize); err != nil { return wireSize, err } + // bounds check completed in successful call to unmarshalCheckTypeBounds + data = data[:wireSize] if size, err := Unmarshal(data, &d.NItems); err != nil { return wireSize, err |
