File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -450,11 +450,8 @@ bool checkRtcmMessage(uint8_t data)
450450 {
451451 // Read the upper two bits of the length
452452 case RTCM_TRANSPORT_STATE_READ_LENGTH_1:
453- // PaulZC: The next line checks if the first length byte is zero. Curious...
454- // This limits 'valid' message lengths to 255 bytes instead of 1023. TODO: check this.
455- // Maybe the intent is to check that the 6 unused bits are all zero?
456- // In which case, the next line should be: if (data <= 3)
457- if (!(data & 3 ))
453+ // Verify the length byte - check the 6 MS bits are all zero
454+ if (!(data & (~3 )))
458455 {
459456 length = data << 8 ;
460457 rtcmParsingState = RTCM_TRANSPORT_STATE_READ_LENGTH_2;
@@ -868,7 +865,7 @@ uint8_t rtcmReadLength2(PARSE_STATE * parse, uint8_t data)
868865// Read the upper two bits of the length
869866uint8_t rtcmReadLength1 (PARSE_STATE * parse, uint8_t data)
870867{
871- // Verify the length byte
868+ // Verify the length byte - check the 6 MS bits are all zero
872869 if (data & (~3 ))
873870 {
874871 // Invalid length, place this byte at the beginning of the buffer
You can’t perform that action at this time.
0 commit comments