The record length is checked against the payload byte count.
The length matches the payload bytes
The header says payload length 4, and the payload has 4 bytes.
The full record is nine bytes
Total bytes are header 5 plus payload 4.
A wrong length would not pass
The source helper rejects the record if the length field and payload byte count disagree.
length=4
Summary
The length field gives the receiver a checked boundary for this record.
total bytes=9