From 2f8bfd9906b4148242b31f998acc7a0289251e54 Mon Sep 17 00:00:00 2001 From: Edy Silva Date: Mon, 16 Mar 2026 12:56:46 -0300 Subject: [PATCH 1/2] src,sqlite: fix filterFunc dangling reference --- src/node_sqlite.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node_sqlite.cc b/src/node_sqlite.cc index 9c3aa6e0b4dc5f..8e668cbe552ebf 100644 --- a/src/node_sqlite.cc +++ b/src/node_sqlite.cc @@ -2157,7 +2157,7 @@ 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_) { From a71936c8a7880afa4e83a53f2bfb94e3882c16f0 Mon Sep 17 00:00:00 2001 From: Edy Silva Date: Mon, 16 Mar 2026 13:11:37 -0300 Subject: [PATCH 2/2] src: make linter happy --- 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 8e668cbe552ebf..91b80b4fb44c26 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 = [env, db, filterFunc](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_) {