moov-io / iso8583

A golang implementation to marshal and unmarshal iso8583 message.
https://moov.io
Apache License 2.0
304 stars 100 forks source link

Fuzzer reports me that length should be positive #225

Closed jerome-laforge closed 1 year ago

jerome-laforge commented 1 year ago

with:

panic: runtime error: slice bounds out of range [:-7]
            goroutine 46 [running]:
            runtime/debug.Stack()
                runtime/debug/stack.go:24 +0x9e
            testing.tRunner.func1()
                testing/testing.go:1485 +0x1f6
            panic({0x105b620, 0xc00003e300})
                runtime/panic.go:884 +0x213
            github.com/moov-io/iso8583/field.(*Composite).Unpack(0xc00044e660, {0xc000044377, 0x3, 0x9})
                github.com/moov-io/iso8583@v0.15.3/field/composite.go:271 +0x40a
            github.com/moov-io/iso8583.(*Message).Unpack(0xc000456780, {0xc000044300, 0x7a, 0x80})
                github.com/moov-io/iso8583@v0.15.3/message.go:196 +0x5d8