Uploaded image for project: 'Couchbase Lite'
  1. Couchbase Lite
  2. CBL-6124

HELIUM: Call to c4stream_write with critical array may cause crash

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 3.1.9
    • 3.1.9
    • Java, Java-Android
    • Security Level: Public
    • None
    • 1

    Description

      The optimized call `GetPrimitiveArrayCritical` is unsafe because, after calling it, nearly any Java or JNI call prior to calling `ReleasePrimitiveArrayCritical` will cause a crash. This includes logging.

      One of the last uses of the critical call is used copying a Blob data array, prior to calling `c4stream_write`. That seemed like a good idea, because the array is potentially very large. Unfortunately, LiteCore has started logging from its method and that causes a crash.

      This fix is simple: use the normal call: `GetByteArrayElements` instead.

      Attachments

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

        Activity

          People

            blake.meike Blake Meike
            blake.meike Blake Meike
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty