Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-22389

Fix secondary key max length check in index entry

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • 4.6.1
    • 4.5.1
    • secondary-index
    • None
    • Untriaged
    • Yes

    Description

      The secondary key max length check has regressed after secondary key encoding was moved to projector in 4.5.0.

      Right now it works as follows:

      1. If len(key) > maxIndexEntrySize, the key gets skipped
      maxIndexEntrySize = 12546 [(4096 * 3) + 256 + 2]
      where 256 = MAX_DOCID_LEN and 2 is reserved for len of docid.

      2. But after the check, docid and len(docid) are appended to it. This causes the buffer overrun.
      The fix is to check len(key) > maxIndexEntrySize - 256 - 2

      Attachments

        Issue Links

          For Gerrit Dashboard: MB-22389
          # Subject Branch Project Status CR V

          Activity

            People

              prathibha Prathibha Bisarahalli (Inactive)
              deepkaran.salooja Deepkaran Salooja
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                PagerDuty