Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sketchy useage of unsafe_wrap/unsafe_string #41

Open
oscardssmith opened this issue Dec 6, 2024 · 1 comment
Open

Sketchy useage of unsafe_wrap/unsafe_string #41

oscardssmith opened this issue Dec 6, 2024 · 1 comment

Comments

@oscardssmith
Copy link

This library makes heavy use of unsafe_wrap and unsafe_string, (see

function _mbd_unpack(::Type{T}, mdb_val::MDB_val) where {T <: String}
) but doesn't seem to ensure that they aren't used on data that comes from Julia. The intention of these functions is that they are used on foreign memory only (since otherwise, you will get a double free when the original and wrapped version both get freed).

@vtjnash
Copy link

vtjnash commented Dec 19, 2024

The issue isn't that (per se) but rather that the call to pointer in the constructor likely destroys the GC information, leading to use after free bugs later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants