FyroxEngine / Fyrox

3D and 2D game engine written in Rust
https://fyrox.rs
MIT License
7.51k stars 341 forks source link

Fixing Potential Double Free Issue #475

Closed kuzeyardabulut closed 11 months ago

kuzeyardabulut commented 11 months ago

I detected several double free bugs in your project via static analysis. Double free will appear when Vec::from_raw_parts function panics.

https://github.com/FyroxEngine/Fyrox/blob/af36a53e01d3b75c203bfc33daee6f103ed0dc49/src/scene/mesh/buffer.rs#L515-L521

You should use std::mem::ManuallyDrop::new.

kuzeyardabulut commented 11 months ago

PR: #476