Details
-
Bug
-
Resolution: Fixed
-
Critical
-
3.1.9
-
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.