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

Off-by-one error (potential buffer overflow) in buf_to_printable_buffer

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 4.1.1, 4.5.0
    • 2.5.2, 3.1.3, 4.1.0, 4.5.0
    • memcached
    • Security Level: Public
    • None
    • Untriaged
    • Unknown

    Description

      If buf_to_printable_buffer() is passed a source buf which is larger than
      dest buf, it attempts to only process as many bytes as will fit in the
      destination. However there is an off-by-one error when writing the
      trailing \0 which causes it to overwrite the end of the destination
      buffer.

      Identified during testing of some long sub-document mutation paths.

      Note this code is only executed if memcached's verbosity is set to '2' or higher (default in production is 1), hence the fact that we've not (to my knowledge) seen any production issues.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              drigby Dave Rigby (Inactive)
              drigby Dave Rigby (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  PagerDuty