From ede52bc2dcfcf9e5aab0aa13c8b2cd492fce309f 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 9c3aa6e0b4d..91b80b4fb44 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_) {