forked from security/hakurei
internal/pipewire: bounds check against wire size
This covers cases where wire size is not known ahead of time. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user