squadracorsepolito / jsondbc

JSON to dbc converter
MIT License
3 stars 1 forks source link

impl boundary check on readMessage function #13

Closed kelvincesar closed 2 months ago

kelvincesar commented 2 months ago

Hello,

I was receiving the following error for a DBC of mine:

panic: runtime error: index out of range [48] with length 48
goroutine 1 [running]:
github.com/squadracorsepolito/jsondbc/pkg.(*textReader).readMessage(0xc000127ae0, 0x2e)
        /home/kelvinc/git/jsondbc/pkg/text_reader.go:351 +0xd91
github.com/squadracorsepolito/jsondbc/pkg.(*textReader).handleMessages(0xc000127ae0?, {0xc0000246c0, 0x6, 0xc000127960?})
...

I fixed inserting a validation on the for loop.

Best regards, Kelvin

FerroO2000 commented 2 months ago

Thanks for the contribution, it will be included with the next release