sqlite: fix stack-use-after-scope with function callback#63640
Conversation
The `hasIt` block has `Local<Function>`s, but it's capture in the lambda, yet the lambda is used after the locals go out of scope. Signed-off-by: ndossche <nora.dossche@ugent.be>
|
Review requested:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #63640 +/- ##
==========================================
- Coverage 90.30% 90.28% -0.03%
==========================================
Files 730 730
Lines 234802 234804 +2
Branches 43957 43947 -10
==========================================
- Hits 212041 211991 -50
- Misses 14485 14547 +62
+ Partials 8276 8266 -10
🚀 New features to boost your workflow:
|
Sure, but they are copied by value, not by reference, so that shouldn't be inherently problematic. The real issue here to me seems to be that we're placing We could pass either |
The
hasItblock hasLocal<Function>s, but it's capture in the lambda, yet the lambda is used after the locals go out of scope.This can be triggered by just running the test suite under ASAN.
ASAN report:
Note: this was found by a static-dynamic analyser I'm developing.