Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-36714

Rows_log_event::write_data_header overallocates buffer size

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Trivial
    • Resolution: Fixed
    • 10.11, 11.4, 11.8
    • 12.0.1
    • Replication
    • None

    Description

      Nothing is broken by this, but the function Rows_log_event::write_data_header slightly over-allocates its buf by 2 bytes. It allocates 10 (ROWS_HEADER_LEN_V2), but only 8 are ever written (ROWS_HEADER_LEN).

      bool Rows_log_event::write_data_header()
      {
        uchar buf[ROWS_HEADER_LEN_V2];        // No need to init the buffer
        DBUG_ASSERT(m_table_id != UINT32_MAX);
        DBUG_EXECUTE_IF("old_row_based_repl_4_byte_map_id_master",
                        {
                          int4store(buf + 0, (ulong) m_table_id);
                          int2store(buf + 4, m_flags);
                          return (write_data(buf, 6));
                        });
        int6store(buf + RW_MAPID_OFFSET, m_table_id);
        int2store(buf + RW_FLAGS_OFFSET, m_flags);
        return write_data(buf, ROWS_HEADER_LEN);
      }
      

      Attachments

        Activity

          People

            bnestere Brandon Nesterenko
            bnestere Brandon Nesterenko
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.