Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
3.3, 3.4
-
None
Description
In libmariadb/mariadb_rpl.c, the mariadb_rpl_fetch() function calls get_compression_info(ev, &algorithm, &header_size) inside the compressed rows-event branch prior to verifying whether sufficient bytes remain in the allocated event buffer (ev_end - ev).
Inside get_compression_info(), after testing the buf[0] marker byte, the pointer is incremented (buf++) and reads the uncompressed length field without taking ev_end into account.
If a compressed rows event contains a row-data section shorter than expected by the compression header, an out-of-bounds heap read occurs. The caller's existing length check (header_size >= (ev_end - ev)) only executes after the out-of-bounds read has already taken place (a check-after-use pattern).