mavlink/mavlink — pull request #46 by rlhartley (2012-07-05 18:02:41+00:00)
Title: check message length in parser

There is no upper bound on how long it may take the parser to resynchronize with the incoming message stream, there are even sequences of valid messages for which it never will. This is hard to fix completely without rescanning the input whenever a parse error is detected (which may not be compatible with hard real time), but can be alleviated by detecting invalid messages as soon as possible.

One way to do that, without changing the protocol or API at all, is to check that the payload length matches the message ID.

This would need to be changed slightly, if/when any variable length messages are defined.