From 8b8129b2e2857164c17c324c0c3a096ea12ceed7 Mon Sep 17 00:00:00 2001 From: Joel Wetzell Date: Wed, 20 May 2026 17:41:37 -0500 Subject: [PATCH] add size check to bundle content --- bundle.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bundle.go b/bundle.go index c3dac53..0dbe158 100644 --- a/bundle.go +++ b/bundle.go @@ -66,6 +66,10 @@ func BundleFromBytes(bytes []byte) (*OSCBundle, []byte, error) { remainingBytes = bytesAfterContentSize + if contentSize <= 0 { + return nil, remainingBytes, errors.New("bundle content size must be positive") + } + if len(remainingBytes) < int(contentSize) { return nil, remainingBytes, errors.New("bundle doesn't have enough bytes for the content size it specifies") }