Repository navigation
extmod/modbtree: Add checks for already-closed database. - #12949
Conversation
|
Code size report: |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #12949 +/- ##
=======================================
Coverage 98.42% 98.42%
=======================================
Files 161 161
Lines 21252 21266 +14
=======================================
+ Hits 20918 20932 +14
Misses 334 334 ☔ View full report in Codecov by Sentry. |
|
Can you add a test showing this check works? |
|
This is an automated heads-up that we've just merged a Pull Request See #13763 A search suggests this PR might apply the STATIC macro to some C code. If it Although this is an automated message, feel free to @-reply to me directly if |
Fixes use-after-free when accessing the database after it is closed with `btree_close`. `btree_close` always succeeds when called with an already-closed database. The new test checks that operations that access the underlying database (get, set, flush, seq) fail with a `ValueError` when the btree is already closed. It also checks that closing and printing the btree succeed when the btree is already closed. Fixes issue micropython#12543. Signed-off-by: Michael Vornovitsky <[email protected]>
f2f58a5 to
6db91df
Compare
|
Thanks for adding the test, it looks good. Rebased and merged. |
Fixes use-after-free when accessing the database after it is closed
with btree_close. btree_close always succeeds when called with
an already-closed database.
Fixes issue #12543.