forked from security/hakurei
internal/pipewire: zero size before validation
Leftover values from previous invocations cause incorrect behaviour here. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user