HELIUM: Call to c4stream_write with critical array may cause crash

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.

Activity

Show:
Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Story Points

Components

Fix versions

Affects versions

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created July 31, 2024 at 5:21 PM
Updated August 8, 2024 at 12:16 AM
Resolved August 8, 2024 at 12:16 AM
Instabug