Skip to content

CBL-8728 : Fix use after free in the lazy vector index tests - #3560

Merged
pasin merged 1 commit into
release/3.4from
CBL-8728
Aug 20, 2026
Merged

CBL-8728 : Fix use after free in the lazy vector index tests#3560
pasin merged 1 commit into
release/3.4from
CBL-8728

Conversation

@pasin

@pasin pasin commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Direct ported from master branch : db1abd2

vectorForWord: returned the CBLArray from a query result, cast to NSArray. That array is only valid while the result set is alive, so callers read freed memory once the enumeration ended. The result was an EXC_BAD_ACCESS crash inside -[CBLIndexUpdater setVector:atIndex:error:] and wrong vectors in the assertions. It only showed up when running against release builds. Copy the values out with -[CBLArray toArray] instead.

@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown

This is a release branch and commits are restricted.

Please confirm this PR is one of the following:

  • A response to a customer ask
  • A change per our security policy
  • A non-functional change (e.g. changes needed for building an older version)
  • A bug fix for a x.y.0 release
  • A change that has been granted an exception (please comment)

Direct ported from master branch : db1abd2

vectorForWord: returned the CBLArray from a query result, cast to
NSArray. That array is only valid while the result set is alive, so
callers read freed memory once the enumeration ended. The result was an
EXC_BAD_ACCESS crash inside -[CBLIndexUpdater setVector:atIndex:error:]
and wrong vectors in the assertions. It only showed up when running
against release builds. Copy the values out with -[CBLArray toArray]
instead.
@pasin
pasin merged commit 850b8e5 into release/3.4 Aug 20, 2026
8 checks passed
@pasin
pasin deleted the CBL-8728 branch August 20, 2026 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants