From 2cb357373586665759687645dc29ca3cf2e31ede Mon Sep 17 00:00:00 2001 From: Edy Silva Date: Wed, 18 Mar 2026 13:15:32 -0300 Subject: [PATCH] src,sqlite: fix filterFunc dangling reference MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/62281 Reviewed-By: René Reviewed-By: Luigi Pinca --- src/node_sqlite.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/node_sqlite.cc b/src/node_sqlite.cc index 7050d26ce44..f7942f68fdb 100644 --- a/src/node_sqlite.cc +++ b/src/node_sqlite.cc @@ -2157,7 +2157,8 @@ void DatabaseSync::ApplyChangeset(const FunctionCallbackInfo& args) { Local filterFunc = filterValue.As(); - context.filterCallback = [&](std::string_view item) -> bool { + context.filterCallback = + [env, db, filterFunc](std::string_view item) -> bool { // If there was an error in the previous call to the filter's // callback, we skip calling it again. if (db->ignore_next_sqlite_error_) {