Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation of Payload length #26

Open
chelliwell opened this issue Jan 27, 2020 · 0 comments
Open

Validation of Payload length #26

chelliwell opened this issue Jan 27, 2020 · 0 comments

Comments

@chelliwell
Copy link
Contributor

Hi, I've got <1 day experience with your library, but it's looking good so far!
I quickly catapulted a project together today for our system [we get raw AIS bytes, so I'm side-stepping the NMEA sentence parsing] and noticed that it seems possible to chuck invalid messages at it - e.g. a Message type 5 with only 2 bytes.
With many (all?) of the AIS message types being defined as a fixed numbers of bits, I was wondering if AisParser should throw if the Payload is too short (or too long) for the message type indicated by the first byte?
I've only been reading AIS spec for a couple of weeks, so apologies if I've over-simplified, but just looking to ensure catching rogue/corner cases in our code too.
'For discussion', not a criticism ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant