WL#11567: Robust event deserialization by libbinlogevents

Affects: Server-8.0   —   Status: Complete

Event deserialization in libbinlogevents must ensure that it will never read
outside the limits of the buffer being deserialized.

When an event deserialization tries to reach out of buffer positions, the event
shall be considered as invalid and cannot be applied (by replication
applier|worker threads) or displayed (by mysqlbinlog client program or SHOW
BINARY|RELAY LOG EVENTS).

This worklog aims to create a buffer reader interface and class at
libbinlogevents to ease and standardize events deserialization with respect to
avoiding reads out of buffer boundaries. This interface shall provide all buffer
access types libbinlogevents needs to deserialize events, for example:
- memcpy: copy a portion of the buffer to other memory buffer;
- get ordinary values: copy a value from the buffer, such as byte, integer,
  long, sometimes doing additional operations such as le16toh, le32toh, le64toh;
- strings: copy a string content from the buffer;
- get_field_length: get a packed field length from the buffer;

Use case: As a MySQL user, I want to know that my MySQL server is robust by
default and will not crash or leak data when replicating corrupt events,
regardless of the use of binary logging checksums.